Comparing version 2.99.0 to 3.0.0
@@ -70,5 +70,7 @@ var path = require('path'), | ||
color = process.stdout.isTTY || false, | ||
reporter, | ||
configPath, | ||
filter, | ||
stopOnFailure, | ||
failFast, | ||
random, | ||
@@ -86,2 +88,4 @@ seed; | ||
stopOnFailure = arg.match("^--stop-on-failure=(.*)")[1] === 'true'; | ||
} else if (arg.match("^--fail-fast=")) { | ||
failFast = arg.match("^--fail-fast=(.*)")[1] === 'true'; | ||
} else if (arg.match("^--random=")) { | ||
@@ -93,2 +97,4 @@ random = arg.match("^--random=(.*)")[1] === 'true'; | ||
configPath = arg.match("^--config=(.*)")[1]; | ||
} else if (arg.match("^--reporter=")) { | ||
reporter = arg.match("^--reporter=(.*)")[1]; | ||
} else if (isFileArg(arg)) { | ||
@@ -105,3 +111,5 @@ files.push(arg); | ||
stopOnFailure: stopOnFailure, | ||
failFast: failFast, | ||
helpers: helpers, | ||
reporter: reporter, | ||
files: files, | ||
@@ -119,2 +127,5 @@ random: random, | ||
} | ||
if (env.failFast !== undefined) { | ||
jasmine.stopOnSpecFailure(env.failFast); | ||
} | ||
if (env.seed !== undefined) { | ||
@@ -129,2 +140,7 @@ jasmine.seed(env.seed); | ||
} | ||
if (env.reporter !== undefined) { | ||
var Report = require(env.reporter); | ||
jasmine.clearReporters(); | ||
jasmine.addReporter(new Report()); | ||
} | ||
jasmine.showColors(env.color); | ||
@@ -197,3 +213,5 @@ jasmine.execute(env.files, env.filter); | ||
print('%s\t[true|false] stop spec execution on expectation failure', lPad('--stop-on-failure=', 18)); | ||
print('%s\t[true|false] stop Jasmine execution on spec failure', lPad('--fail-fast=', 18)); | ||
print('%s\tpath to your optional jasmine.json', lPad('--config=', 18)); | ||
print('%s\tpath to reporter to use instead of the default Jasmine reporter', lPad('--reporter=', 18)); | ||
print(''); | ||
@@ -200,0 +218,0 @@ print('The given arguments take precedence over options in your jasmine.json'); |
@@ -10,3 +10,3 @@ { | ||
"stopSpecOnExpectationFailure": false, | ||
"random": false | ||
"random": true | ||
} |
var path = require('path'), | ||
util = require('util'), | ||
glob = require('glob'), | ||
exit = require('./exit'), | ||
CompletionReporter = require('./reporters/completion_reporter'), | ||
@@ -17,3 +16,2 @@ ConsoleSpecFilter = require('./filters/console_spec_filter'); | ||
this.projectBaseDir = options.projectBaseDir || path.resolve(); | ||
this.printDeprecation = options.printDeprecation || require('./printDeprecation'); | ||
this.specDir = ''; | ||
@@ -26,3 +24,3 @@ this.specFiles = []; | ||
this.onCompleteCallbackAdded = false; | ||
this.exit = exit; | ||
this.exit = process.exit; | ||
this.showingColors = true; | ||
@@ -82,5 +80,2 @@ this.reporter = new module.exports.ConsoleReporter(); | ||
if(options.onComplete) { | ||
this.printDeprecation('Passing in an onComplete function to configureDefaultReporter is deprecated.'); | ||
} | ||
this.reporter.setOptions(options); | ||
@@ -118,5 +113,15 @@ this.defaultReporterConfigured = true; | ||
this.specDir = config.spec_dir || this.specDir; | ||
this.env.throwOnExpectationFailure(config.stopSpecOnExpectationFailure); | ||
this.env.randomizeTests(config.random); | ||
if (config.stopSpecOnExpectationFailure !== undefined) { | ||
this.env.throwOnExpectationFailure(config.stopSpecOnExpectationFailure); | ||
} | ||
if (config.stopOnSpecFailure !== undefined) { | ||
this.env.stopOnSpecFailure(config.stopOnSpecFailure); | ||
} | ||
if (config.random !== undefined) { | ||
this.env.randomizeTests(config.random); | ||
} | ||
if(config.helpers) { | ||
@@ -161,8 +166,12 @@ this.addHelperFiles(config.helpers); | ||
Jasmine.prototype.stopOnSpecFailure = function(value) { | ||
this.env.stopOnSpecFailure(value); | ||
}; | ||
Jasmine.prototype.exitCodeCompletion = function(passed) { | ||
if(passed) { | ||
this.exit(0, process.platform, process.version, process.exit, require('exit')); | ||
this.exit(0); | ||
} | ||
else { | ||
this.exit(1, process.platform, process.version, process.exit, require('exit')); | ||
this.exit(1); | ||
} | ||
@@ -169,0 +178,0 @@ }; |
module.exports = function() { | ||
var results = true; | ||
var onCompleteCallback = function() {}; | ||
@@ -12,6 +11,3 @@ var completed = false; | ||
completed = true; | ||
if (result && result.failedExpectations && result.failedExpectations.length > 0) { | ||
results = false; | ||
} | ||
onCompleteCallback(results); | ||
onCompleteCallback(result.overallStatus === 'passed'); | ||
}; | ||
@@ -22,14 +18,2 @@ | ||
}; | ||
this.specDone = function(result) { | ||
if(result.status === 'failed') { | ||
results = false; | ||
} | ||
}; | ||
this.suiteDone = function(result) { | ||
if (result.failedExpectations && result.failedExpectations.length > 0) { | ||
results = false; | ||
} | ||
}; | ||
}; |
@@ -13,3 +13,2 @@ module.exports = exports = ConsoleReporter; | ||
jasmineCorePath = null, | ||
printDeprecation = function() {}, | ||
specCount, | ||
@@ -27,4 +26,3 @@ executableSpecCount, | ||
failedSuites = [], | ||
stackFilter = defaultStackFilter, | ||
onComplete = function() {}; | ||
stackFilter = defaultStackFilter; | ||
@@ -42,13 +40,5 @@ this.setOptions = function(options) { | ||
} | ||
if (options.printDeprecation) { | ||
printDeprecation = options.printDeprecation; | ||
} | ||
if (options.stackFilter) { | ||
stackFilter = options.stackFilter; | ||
} | ||
if(options.onComplete) { | ||
printDeprecation('Passing in an onComplete function to the ConsoleReporter is deprecated.'); | ||
onComplete = options.onComplete; | ||
} | ||
}; | ||
@@ -79,2 +69,10 @@ | ||
for(i = 0; i < failedSuites.length; i++) { | ||
suiteFailureDetails(failedSuites[i]); | ||
} | ||
if (result && result.failedExpectations && result.failedExpectations.length > 0) { | ||
suiteFailureDetails(result); | ||
} | ||
if (pendingSpecs.length > 0) { | ||
@@ -111,16 +109,12 @@ print("Pending:"); | ||
for(i = 0; i < failedSuites.length; i++) { | ||
suiteFailureDetails(failedSuites[i]); | ||
if (result && result.overallStatus === 'incomplete') { | ||
print('Incomplete: ' + result.incompleteReason); | ||
printNewline(); | ||
} | ||
if (result && result.failedExpectations) { | ||
suiteFailureDetails(result); | ||
} | ||
if (result && result.order && result.order.random) { | ||
print('Randomized with seed ' + result.order.seed); | ||
print(' (jasmine --random=true --seed=' + result.order.seed + ')'); | ||
printNewline(); | ||
} | ||
onComplete(failureCount === 0); | ||
}; | ||
@@ -205,3 +199,12 @@ | ||
print(result.fullName); | ||
printFailedExpectations(result); | ||
} | ||
function suiteFailureDetails(result) { | ||
printNewline(); | ||
print('Suite error: ' + result.fullName); | ||
printFailedExpectations(result); | ||
} | ||
function printFailedExpectations(result) { | ||
for (var i = 0; i < result.failedExpectations.length; i++) { | ||
@@ -222,13 +225,2 @@ var failedExpectation = result.failedExpectations[i]; | ||
function suiteFailureDetails(result) { | ||
for (var i = 0; i < result.failedExpectations.length; i++) { | ||
printNewline(); | ||
print(colored('red', 'An error was thrown in an afterAll')); | ||
printNewline(); | ||
print(colored('red', 'AfterAll ' + result.failedExpectations[i].message)); | ||
} | ||
printNewline(); | ||
} | ||
function pendingSpecDetails(result, pendingSpecNumber) { | ||
@@ -235,0 +227,0 @@ printNewline(); |
@@ -12,3 +12,3 @@ { | ||
"license": "MIT", | ||
"version": "2.99.0", | ||
"version": "3.0.0", | ||
"repository": { | ||
@@ -22,5 +22,4 @@ "type": "git", | ||
"dependencies": { | ||
"exit": "^0.1.2", | ||
"glob": "^7.0.6", | ||
"jasmine-core": "~2.99.0" | ||
"jasmine-core": "~3.0.0" | ||
}, | ||
@@ -30,7 +29,7 @@ "bin": "./bin/jasmine.js", | ||
"devDependencies": { | ||
"grunt": "^0.4.2", | ||
"grunt-cli": "^0.1.13", | ||
"grunt-contrib-jshint": "^0.11.0", | ||
"shelljs": "^0.3.0" | ||
"grunt": "^1.0.1", | ||
"grunt-cli": "^1.2.0", | ||
"grunt-contrib-jshint": "^1.1.0", | ||
"shelljs": "^0.7.8" | ||
} | ||
} |
@@ -15,3 +15,3 @@ [![Build Status](https://travis-ci.org/jasmine/jasmine-npm.png?branch=master)](https://travis-ci.org/jasmine/jasmine-npm) | ||
https://jasmine.github.io/2.8/node.html | ||
https://jasmine.github.io/edge/node.html | ||
@@ -47,3 +47,3 @@ ## Installation | ||
You may use dir glob strings. | ||
More information on the format of `jasmine.json` can be found in [the documentation](http://jasmine.github.io/2.4/node.html#section-Configuration) | ||
More information on the format of `jasmine.json` can be found in [the documentation](http://jasmine.github.io/edge/node.html#section-Configuration) | ||
@@ -50,0 +50,0 @@ Alternatively, you may specify the path to your `jasmine.json` by setting an environment variable or an option: |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
2
25934
14
699
8
+ Addedjasmine-core@3.0.0(transitive)
- Removedexit@^0.1.2
- Removedexit@0.1.2(transitive)
- Removedjasmine-core@2.99.1(transitive)
Updatedjasmine-core@~3.0.0