gulp-jasmine-phantom
Advanced tools
Comparing version 2.1.0 to 3.0.0-rc1
64
index.js
'use strict'; | ||
var path = require('path'), | ||
var _ = require('lodash'), | ||
exec = require('child_process').execSync, | ||
execFile = require('child_process').execFile, | ||
fs = require('fs'), | ||
glob = require('glob'), | ||
gutil = require('gulp-util'), | ||
through = require('through2'), | ||
glob = require('glob'), | ||
handlebar = require('handlebars'), | ||
fs = require('fs'), | ||
execFile = require('child_process').execFile, | ||
exec = require('child_process').execSync, | ||
requireUncached = require('require-uncached'); | ||
Jasmine = require('jasmine'), | ||
path = require('path'), | ||
through = require('through2'); | ||
@@ -176,5 +177,3 @@ /* | ||
module.exports = function (options) { | ||
var filePaths = [], | ||
miniJasmineLib = requireUncached('minijasminenode2'), | ||
terminalReporter = require('./lib/terminal-reporter.js').TerminalReporter; | ||
var filePaths = []; | ||
@@ -250,31 +249,28 @@ gulpOptions = options || {}; | ||
miniJasmineLib.addSpecs(file.path); | ||
filePaths.push(file.path); | ||
filePaths.push(path.relative(process.cwd(), file.path)); | ||
callback(null, file); | ||
}, | ||
}, | ||
function(callback) { | ||
gutil.log('Running Jasmine with minijasminenode2'); | ||
gutil.log('Running Jasmine in Node'); | ||
try { | ||
miniJasmineLib.executeSpecs({ | ||
reporter: terminalReporter, | ||
showColors: true, | ||
includeStackTrace: gulpOptions.includeStackTrace, | ||
onComplete: function() { | ||
if(gulpOptions.keepRunner) { | ||
try { | ||
compileRunner({ | ||
files: filePaths, | ||
onComplete: function() { | ||
callback(null); | ||
} | ||
}); | ||
} catch(error) { | ||
callback(new gutil.PluginError('gulp-jasmine-phantom', error)); | ||
} | ||
} else { | ||
callback(null); | ||
} | ||
} | ||
var jasmine = new Jasmine(), | ||
terminalReporter = require('./lib/terminal-reporter.js').TerminalReporter; | ||
jasmine.addReporter(new terminalReporter(_.defaults(gulpOptions, {showColors: true}))); | ||
jasmine.loadConfig({ | ||
random: _.get(gulpOptions, 'random', false), | ||
spec_files: filePaths | ||
}); | ||
if (_.has(gulpOptions, 'seed')) { | ||
jasmine.seed(gulpOptions.seed); | ||
} | ||
jasmine.onComplete(function(passed) { | ||
callback(null); | ||
}); | ||
jasmine.execute(); | ||
} catch(error) { | ||
@@ -281,0 +277,0 @@ callback(new gutil.PluginError('gulp-jasmine-phantom', error)); |
@@ -33,3 +33,3 @@ var noopTimer = { | ||
this.jasmineDone = function() { | ||
this.jasmineDone = function(result) { | ||
printNewline(); | ||
@@ -70,2 +70,7 @@ for (var i = 0; i < failedSpecs.length; i++) { | ||
if (result && result.order && result.order.random) { | ||
print('Randomized with seed ' + result.order.seed); | ||
printNewline(); | ||
} | ||
done(failureCount === 0); | ||
@@ -72,0 +77,0 @@ }; |
{ | ||
"name": "gulp-jasmine-phantom", | ||
"version": "2.1.0", | ||
"version": "3.0.0-rc1", | ||
"description": "Jasmine 2.0 suite runner, optionally with PhantomJS", | ||
@@ -25,8 +25,8 @@ "license": "MIT", | ||
"dependencies": { | ||
"glob": "^4.0.6", | ||
"gulp-util": "^3.0.0", | ||
"minijasminenode2": "dflynn15/minijasminenode", | ||
"through2": "^0.6.1", | ||
"handlebars": "^2.0.0", | ||
"require-uncached": "^1.0.2", | ||
"glob": "^4.0.6" | ||
"jasmine": "dflynn15/jasmine-npm", | ||
"lodash": "^4.3.0", | ||
"through2": "^0.6.1" | ||
}, | ||
@@ -37,5 +37,4 @@ "devDependencies": { | ||
"gulp-jasmine": "^1.0.1", | ||
"jasmine": "^2.0.1", | ||
"jasmine-fixture": "^1.0.8" | ||
} | ||
} |
@@ -84,8 +84,2 @@ gulp-jasmine-phantom | ||
#### jasmineVersion | ||
Type: `string` <br /> | ||
Default: '2.0' | ||
Specifies the version of Jasmine you want to run. Possible options are in the `vendor/` folder. Just specify what `2.x` minor release you want. | ||
#### integration | ||
@@ -139,2 +133,21 @@ Type: `boolean` <br /> | ||
#### jasmineVersion (integration tests only) | ||
Type: `string` <br /> | ||
Default: '2.0' | ||
**Only use in combination with `integration: true`** | ||
Specifies the version of Jasmine you want to run. Possible options are in the `vendor/` folder. Just specify what `2.x` minor release you want. | ||
#### random (unit tests only) | ||
Type: 'boolean'<br /> | ||
Default: false | ||
Allows you to run the unit tests in a semi-random order. The random seed will be printed out after the tests have completed to allow for easier debugging. | ||
#### seed (unit tests only) | ||
Type: 'number'<br /> | ||
Provides a given seed to Jasmine to run the tests in. | ||
Technologies Used | ||
@@ -141,0 +154,0 @@ ----------------- |
GitHub dependency
Supply chain riskContains a dependency which resolves to a GitHub URL. Dependencies fetched from GitHub specifiers are not immutable can be used to inject untrusted code or reduce the likelihood of a reproducible install.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
GitHub dependency
Supply chain riskContains a dependency which resolves to a GitHub URL. Dependencies fetched from GitHub specifiers are not immutable can be used to inject untrusted code or reduce the likelihood of a reproducible install.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
644637
4
156
16466
2
+ Addedjasmine@dflynn15/jasmine-npm
+ Addedlodash@^4.3.0
+ Addedlodash@4.17.21(transitive)
- Removedrequire-uncached@^1.0.2
- Removedcaller-path@0.1.0(transitive)
- Removedcallsites@0.2.0(transitive)
- Removedrequire-uncached@1.0.3(transitive)
- Removedresolve-from@1.0.1(transitive)