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

mocha-retry

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mocha-retry - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

73

bddRetryInterface.js
// 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"

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