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.10.1 to 3.10.2

2

babel.js

@@ -1,1 +0,1 @@

module.export = require('./lib/babel');
module.exports = require('./lib/babel');
{
"name": "rewiremock",
"version": "3.10.1",
"version": "3.10.2",
"description": "Advanced dependency mocking device.",

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

@@ -163,5 +163,20 @@ # rewiremock

1. Add `rewiremock/babel' into plugin section in `.babelrc`
### Limitations
- This babel plugin __does not work__ if "modules" are not handled by babel. Ie in case of webpack harmony imports.
- Other babel plugins, including JSX, does not work inside webpack _hoisted_ code.
1. Add `rewiremock/babel` into plugin section in `.babelrc`
```js
// .babelrc
{
"presets": [
//.....
],
"plugins": [
"rewiremock/babel"
]
}
```
2. This example will be transpiled into
```jsjs
```js
import sinon from 'sinon';

@@ -185,4 +200,4 @@ import rewiremock from 'rewiremock';

Keep in mind - rewiremock will hoist mock definition next to rewiremock import.
- You can use anything above rewiremock import
- You can mock anything below rewiremock import
- You can __use__ anything __above__ rewiremock import
- You can __mock__ anything __below__ rewiremock import

@@ -189,0 +204,0 @@ ### Changing the mocks after the mocking

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