Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "it-fails", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "", | ||
@@ -10,3 +10,4 @@ "main": "src/index.js", | ||
"demo2": "mocha test/fixtures/expected-fail.js || echo 'some tests failed'", | ||
"demo3": "mocha test/fixtures/unexpected-pass.js || echo 'some tests failed'" | ||
"demo3": "mocha test/fixtures/unexpected-pass.js || echo 'some tests failed'", | ||
"demo4": "mocha test/fixtures/multiple/*.js || echo 'some tests failed'" | ||
}, | ||
@@ -13,0 +14,0 @@ "author": "Michael Rawlings <ml.rawlings@gmail.com>", |
@@ -5,4 +5,10 @@ "use strict"; | ||
const it = mocha.it; | ||
const suite = it('').parent; | ||
suite.tests.splice(0, 1); | ||
it.fails = function() { | ||
suite.on('pre-require', (context) => { | ||
patchIt(context.it); | ||
}); | ||
const patchIt = (it) => it.fails = function() { | ||
let test = it.apply(this, arguments); | ||
@@ -13,3 +19,5 @@ test.shouldFail = true; | ||
patchIt(it); | ||
require('./patch-runner'); | ||
require('./patch-base-reporter'); |
@@ -42,2 +42,10 @@ const path = require('path'); | ||
console.log(stdout); | ||
}); | ||
it('multiple', async () => { | ||
let { stdout, code } = await test('multiple/*.js'); | ||
expect(code).to.equal(0); | ||
expect(stdout).to.contain('0 passing'); | ||
expect(stdout).to.contain('2 failing as expected'); | ||
console.log(stdout); | ||
}); |
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
12040
14
256