jasmine-slow-spec-reporter
Advanced tools
Comparing version 0.2.0 to 0.3.0
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 3 instances in 1 package
145
0
6409
2
7
+ Addedlodash@^4.17.4
+ Addedlodash@4.17.21(transitive)