babel-plugin-mockable-imports
Advanced tools
Comparing version 1.3.1 to 1.4.0
@@ -8,2 +8,8 @@ # Changelog | ||
## [1.4.0] - 2019-05-08 | ||
- Ignore Babel-generated CommonJS imports (https://github.com/robertknight/babel-plugin-mockable-imports/pull/8). | ||
The plugin uses the heuristic that CommonJS imports are auto-generated if | ||
the variable name starts with an underscore. | ||
## [1.3.0] - 2019-04-11 | ||
@@ -10,0 +16,0 @@ |
@@ -135,3 +135,10 @@ 'use strict'; | ||
const id = path.node.id; | ||
if (id.type === 'Identifier') { | ||
if (id.name.startsWith('_')) { | ||
// Assume that imports with an underscore-prefixed name have been | ||
// automatically generated by Babel. Do not make them mockable. | ||
return; | ||
} | ||
const symbol = '<CJS>'; | ||
@@ -138,0 +145,0 @@ imports.push({ |
{ | ||
"name": "babel-plugin-mockable-imports", | ||
"version": "1.3.1", | ||
"version": "1.4.0", | ||
"description": "Babel plugin for mocking ES imports", | ||
"main": "index.js", | ||
"scripts": { | ||
"checkformatting": "prettier --check **/*.js", | ||
"build": "babel helpers.js --out-dir lib", | ||
"lint": "eslint --ignore-pattern lib/* .", | ||
"format": "prettier --write **/*.js", | ||
"test": "mocha", | ||
"test": "mocha && npm run lint && npm run checkformatting", | ||
"prepublishOnly": "npm run build" | ||
@@ -11,0 +13,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
33930
526