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

rewiremock

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rewiremock - npm Package Compare versions

Comparing version 3.1.0 to 3.1.1

2

es/executor.js

@@ -85,5 +85,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

if (asyncModulesLeft) {
/* eslint-disable no-console */
console.error('Rewiremock: listed async modules should finish loading first. Use async API of rewiremock.', asyncModulesLeft.map(function (module) {
return module.creator.toString();
}));
/* eslint-enable */
throw new Error('Rewiremock: listed async modules should finish loading first. Use async API of rewiremock.');

@@ -90,0 +92,0 @@ }

@@ -107,5 +107,7 @@ 'use strict';

if (asyncModulesLeft) {
/* eslint-disable no-console */
console.error('Rewiremock: listed async modules should finish loading first. Use async API of rewiremock.', asyncModulesLeft.map(function (module) {
return module.creator.toString();
}));
/* eslint-enable */
throw new Error('Rewiremock: listed async modules should finish loading first. Use async API of rewiremock.');

@@ -112,0 +114,0 @@ }

14

package.json
{
"name": "rewiremock",
"version": "3.1.0",
"version": "3.1.1",
"description": "Easy and es6 compatible dependency mocking tool.",

@@ -15,5 +15,5 @@ "main": "lib/index.js",

"test:jest": "NODE_ENV=cjs jest",
"build": "npm run build5 && npm run build6",
"build5": "BABEL_ENV=cjs babel src -d lib & cp src/index.js.flow lib/index.js.flow",
"build6": "BABEL_ENV=ejs babel src -d es & cp src/index.js.flow es/index.js.flow",
"build": "npm run build5 & npm run build6",
"build5": "BABEL_ENV=cjs babel src -d lib && cp src/index.js.flow lib/index.js.flow",
"build6": "BABEL_ENV=ejs babel src -d es && cp src/index.js.flow es/index.js.flow",
"prepublish": "npm run build",

@@ -68,3 +68,3 @@ "lint": "eslint src tests",

"babel-eslint": "^7.2.3",
"babel-jest": "false21.2.0",
"babel-jest": "^21.2.0",
"babel-plugin-dynamic-import-node": "^1.0.2",

@@ -78,4 +78,4 @@ "babel-plugin-syntax-dynamic-import": "^6.18.0",

"eslint-plugin-mocha": "^4.9.0",
"flow-bin": "false0.59.0",
"jest-cli": "false21.2.1",
"flow-bin": "^0.59.0",
"jest-cli": "^21.2.1",
"karma": "^1.7.0",

@@ -82,0 +82,0 @@ "karma-chrome-launcher": "^2.2.0",

@@ -377,3 +377,17 @@ # rewiremock [![Build Status](https://secure.travis-ci.org/theKashey/rewiremock.svg)](http://travis-ci.org/theKashey/rewiremock)

!!! the last line here may disable Jest sandboxing. !!!
!!! the last line here may disable Jest sandboxing. !!!
Also it will disable Jest transformation.
To be able continue use ES6/imports - you have to enforce Babel to be applied in the `common` way.
```js
describe('block of tests', () => {
// require babel-register in describe or it block.
// NOT! On top level. Jest sandboxing and isolation are still in action,
// and will reset all settings to default
require("babel-register");
})
```
PS: Jest will set BABEL_ENV to `test`.
It is better just to use `rewiremock.requireActual`, without overriding global require.

@@ -380,0 +394,0 @@

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