Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jasmine-slow-spec-reporter

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jasmine-slow-spec-reporter - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

20

lib/slow_reporter.js

@@ -0,4 +1,9 @@

'use strict'
const chalk = require('chalk')
const blue = chalk.blue
const orange = chalk.keyword('orange')
const values = require('lodash/values')
const filter = require('lodash/filter')
const sortBy = require('lodash/sortBy')

@@ -39,6 +44,5 @@ class SlowReporter {

getSlowRecords () {
const thresholdMs = this._thresholdMs
return Object.values(this._specRecords)
.filter(record => record.durationMs > thresholdMs)
.sort(record => -record.durationMs)
const records = values(this._specRecords)
const filtered = filter(records, (record) => record.durationMs > this._thresholdMs)
return sortBy(filtered, (record) => -record.durationMs)
}

@@ -49,7 +53,11 @@

console.log(blue('Finished suite slow spec threshold:', this._thresholdMs, 'ms'))
console.group()
if (typeof console.group === 'function') {
console.group()
}
slowRecords.forEach(slowRecord => {
console.log(orange(`${slowRecord.durationMs}ms`, slowRecord.fullName))
})
console.groupEnd()
if (typeof console.groupEnd === 'function') {
console.groupEnd()
}
}

@@ -56,0 +64,0 @@ }

@@ -0,1 +1,3 @@

'use strict'
const SlowReporter = require('./slow_reporter')

@@ -2,0 +4,0 @@

{
"name": "jasmine-slow-spec-reporter",
"version": "0.2.0",
"version": "0.3.0",
"description": "Slow test reporter for jasmine",

@@ -22,3 +22,4 @@ "main": "index.js",

"dependencies": {
"chalk": "^2.3.0"
"chalk": "^2.3.0",
"lodash": "^4.17.4"
},

@@ -25,0 +26,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc