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

it-fails

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

it-fails - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

test/fixtures/multiple/test1.js

5

package.json
{
"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>",

10

src/index.js

@@ -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);
});
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