mocha-retry
Advanced tools
Comparing version 0.0.1 to 0.0.2
// Generated by CoffeeScript 1.7.1 | ||
(function() { | ||
var RetryTest, interfaces; | ||
var Mocha, RetryTest, Suite, interfaces, utils; | ||
interfaces = require('mocha').interfaces; | ||
RetryTest = require('./retryTest'); | ||
Mocha = require('mocha'); | ||
interfaces = Mocha.interfaces; | ||
Suite = Mocha.Suite; | ||
utils = Mocha.utils; | ||
module.exports = interfaces.bddretry = function(suite) { | ||
var bdd; | ||
bdd = interfaces.bdd; | ||
bdd(suite); | ||
return suite.on('pre-require', function(context, file, mocha) { | ||
return context.it = context.itretry = function(times, title, fn) { | ||
var test, _ref; | ||
var suites; | ||
suites = [suite]; | ||
return suite.on("pre-require", function(context, file, mocha) { | ||
context.before = function(name, fn) { | ||
return suites[0].beforeAll(name, fn); | ||
}; | ||
context.after = function(name, fn) { | ||
return suites[0].afterAll(name, fn); | ||
}; | ||
context.beforeEach = function(name, fn) { | ||
return suites[0].beforeEach(name, fn); | ||
}; | ||
context.afterEach = function(name, fn) { | ||
return suites[0].afterEach(name, fn); | ||
}; | ||
context.describe = context.context = function(title, fn) { | ||
var asuite; | ||
asuite = Suite.create(suites[0], title); | ||
asuite.file = file; | ||
suites.unshift(asuite); | ||
fn.call(asuite); | ||
suites.shift(); | ||
return asuite; | ||
}; | ||
context.xdescribe = context.xcontext = context.describe.skip = function(title, fn) { | ||
var asuite; | ||
asuite = Suite.create(suites[0], title); | ||
asuite.pending = true; | ||
suites.unshift(asuite); | ||
fn.call(asuite); | ||
return suites.shift(); | ||
}; | ||
context.describe.only = function(title, fn) { | ||
var asuite; | ||
asuite = context.describe(title, fn); | ||
mocha.grep(asuite.fullTitle()); | ||
return asuite; | ||
}; | ||
context.it = context.itretry = function(times, title, fn) { | ||
var asuite, test, _ref; | ||
asuite = suites[0]; | ||
if (fn == null) { | ||
@@ -20,3 +61,3 @@ _ref = [times, title], title = _ref[0], fn = _ref[1]; | ||
} | ||
if (suite.pending) { | ||
if (asuite.pending) { | ||
fn = null; | ||
@@ -26,5 +67,15 @@ } | ||
test.file = file; | ||
suite.addTest(test); | ||
asuite.addTest(test); | ||
return test; | ||
}; | ||
context.it.only = function(title, fn) { | ||
var reString, test; | ||
test = context.it(title, fn); | ||
reString = "^" + utils.escapeRegexp(test.fullTitle()) + "$"; | ||
mocha.grep(new RegExp(reString)); | ||
return test; | ||
}; | ||
return context.xit = context.xspecify = context.it.skip = function(title) { | ||
return context.it(title); | ||
}; | ||
}); | ||
@@ -31,0 +82,0 @@ }; |
{ | ||
"name": "mocha-retry", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "a way to retry tests", | ||
@@ -8,2 +8,6 @@ "main": "index.js", | ||
"license": "GPLv2", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/giggio/mocha-retry" | ||
}, | ||
"peerDependencies": { | ||
@@ -10,0 +14,0 @@ "mocha": "^1.20.1" |
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
23867
182
0