rewiremock
Advanced tools
Comparing version 3.7.2 to 3.7.3
@@ -17,2 +17,4 @@ import childOnly from './childOnly'; | ||
var mockThroughByDefault = mockThoughByDefault; | ||
var exports = { | ||
@@ -27,3 +29,6 @@ childOnly: childOnly, | ||
disabledByDefault: disabledByDefault, | ||
mockThoughByDefault: mockThoughByDefault, | ||
mockThroughByDefault: mockThroughByDefault, | ||
alwaysMatchOrigin: alwaysMatchOrigin, | ||
@@ -30,0 +35,0 @@ usedByDefault: usedByDefault, |
@@ -61,2 +61,4 @@ 'use strict'; | ||
const mockThroughByDefault = _mockThoughByDefault2.default; | ||
const _exports = { | ||
@@ -71,3 +73,6 @@ childOnly: _childOnly2.default, | ||
disabledByDefault: _disabledByDefault2.default, | ||
mockThoughByDefault: _mockThoughByDefault2.default, | ||
mockThroughByDefault, | ||
alwaysMatchOrigin: _toMatchOrigin2.default, | ||
@@ -74,0 +79,0 @@ usedByDefault: _usedByDefault2.default, |
{ | ||
"name": "rewiremock", | ||
"version": "3.7.2", | ||
"version": "3.7.3", | ||
"description": "Advanced dependency mocking device.", | ||
@@ -11,2 +11,5 @@ "main": "lib/index.js", | ||
"test": "npm run test:pick -- '_tests/**/*spec.js'", | ||
"test:report": "nyc report --reporter=text-lcov > coverage.lcov", | ||
"test:cov": "BABEL_ENV=cjs nyc mocha --compilers js:babel-core/register --report lcovonly -- '_tests/**/*spec.js'", | ||
"test:ci": "npm run test:cov && npm run test:report && codecov", | ||
"test:pick": "BABEL_ENV=cjs mocha --compilers js:babel-core/register", | ||
@@ -82,28 +85,30 @@ "test:karma": "node ./node_modules/karma/bin/karma start --single-run --browsers PhantomJS", | ||
"babel-core": "^6.24.1", | ||
"babel-eslint": "^7.2.3", | ||
"babel-jest": "^21.2.0", | ||
"babel-eslint": "^8.2.3", | ||
"babel-jest": "^23.0.0", | ||
"babel-plugin-dynamic-import-node": "^1.0.2", | ||
"babel-plugin-syntax-dynamic-import": "^6.18.0", | ||
"babel-plugin-transform-object-rest-spread": "^6.23.0", | ||
"babel-preset-env": "1.6.1", | ||
"babel-register": "6.18.0", | ||
"chai": "^3.5.0", | ||
"babel-preset-env": "1.7.0", | ||
"babel-register": "6.26.0", | ||
"chai": "^4.1.2", | ||
"codecov": "^3.0.2", | ||
"eslint": "^4.19.1", | ||
"eslint-plugin-mocha": "^4.9.0", | ||
"flow-bin": "^0.59.0", | ||
"jest-cli": "^21.2.1", | ||
"karma": "^1.7.0", | ||
"eslint-plugin-mocha": "^5.0.0", | ||
"flow-bin": "^0.75.0", | ||
"jest-cli": "^23.0.0", | ||
"karma": "^2.0.2", | ||
"karma-chrome-launcher": "^2.2.0", | ||
"karma-mocha": "^1.3.0", | ||
"karma-phantomjs-launcher": "^1.0.4", | ||
"karma-spec-reporter": "0.0.26", | ||
"karma-webpack": "^2.0.4", | ||
"mocha": "^3.0.2", | ||
"karma-spec-reporter": "0.0.32", | ||
"karma-webpack": "^3.0.0", | ||
"mocha": "^5.2.0", | ||
"nyc": "^12.0.1", | ||
"phantomjs-polyfill": "0.0.2", | ||
"phantomjs-polyfill-object-assign": "0.0.2", | ||
"sinon": "^4.4.2", | ||
"webpack": "^4.2.0", | ||
"webpack-cli": "^2.0.13", | ||
"webpack-dev-server": "^3.1.1" | ||
"sinon": "^5.0.10", | ||
"webpack": "^4.14.0", | ||
"webpack-cli": "^3.0.0", | ||
"webpack-dev-server": "^3.1.4" | ||
} | ||
} |
@@ -1,5 +0,7 @@ | ||
# rewiremock [![Build Status](https://secure.travis-ci.org/theKashey/rewiremock.svg)](http://travis-ci.org/theKashey/rewiremock) | ||
# rewiremock | ||
[![Build Status](https://secure.travis-ci.org/theKashey/rewiremock.svg)](http://travis-ci.org/theKashey/rewiremock) | ||
[![coverage-badge](https://img.shields.io/codecov/c/github/thekashey/rewiremock.svg?style=flat-square)](https://codecov.io/github/thekashey/rewiremock) | ||
[![version-badge](https://img.shields.io/npm/v/rewiremock.svg?style=flat-square)](https://www.npmjs.com/package/rewiremock) | ||
[![Greenkeeper badge](https://badges.greenkeeper.io/theKashey/rewiremock.svg)](https://greenkeeper.io/) | ||
[![NPM](https://nodei.co/npm/rewiremock.png?downloads=true&stars=true)](https://nodei.co/npm/rewiremock/) | ||
The most powerful mocking library, inspired by the best libraries: | ||
@@ -60,3 +62,3 @@ - [mockery](https://github.com/mfncooper/mockery) - Rewiremock __is__ a better mockery. | ||
- rewiremock.withoutIsolation() - disables isolation | ||
- rewiremock.passBy(pattern or function) - enables some modules to pass thought isolation. | ||
- rewiremock.passBy(pattern or function) - enables some modules to pass throught isolation. | ||
## sandboxing | ||
@@ -82,7 +84,7 @@ - rewiremock.inScope(callback) - place synchronous callback inside a sandbox. | ||
- (jest) one could mock everything, but requires babel plugin. And there is one way to use it. Refer to Hoisted mocking. | ||
- (common) second will _require_ a file, overriding depenedies. And there are many ways to use it. | ||
- (common) second will _require_ a file, overriding dependencies. And there are many ways to use it. | ||
### A common way to mock. | ||
Rewiremock provides lots of APIs to help you setup mock, and get the mocked module. | ||
- If everything is simply - use __rewiremock.proxy__. (~proxyquire) | ||
- If everything is simple - use __rewiremock.proxy__. (~proxyquire) | ||
- If you have issues with name resolve - use __rewiremock.module__ and resolve names by yourself. | ||
@@ -140,3 +142,3 @@ - If you need scope isolation - use __rewiremock.around__, or inScope. | ||
```js | ||
addPlugin(plugins.mockThoughByDefault); | ||
addPlugin(plugins.mockThroughByDefault); | ||
``` | ||
@@ -491,3 +493,3 @@ | ||
- disabledByDefault. All mocks will be disabled on create and at the end of each cycle. | ||
- mockThoughByDefault. All mocks mocked though. | ||
- mockThroughByDefault. All mocks mocked through. | ||
- usedByDefault. All mocks to be used by fact (reverse isolation) | ||
@@ -508,3 +510,3 @@ ```javascript | ||
# Isolation | ||
Unit testing requires all decencies to be mocked. All! | ||
Unit testing requires all dependencies to be mocked. All! | ||
To enable it, run | ||
@@ -511,0 +513,0 @@ ```javascript |
163386
3525
681
29