rewiremock
Advanced tools
Comparing version 3.1.0 to 3.1.1
@@ -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 @@ } |
{ | ||
"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 @@ |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
495
13
128202
61
2778