babel-plugin-mockable-imports
Advanced tools
Comparing version 1.5.0 to 1.5.1
@@ -8,2 +8,8 @@ # Changelog | ||
## [1.5.1] - 2019-05-29 | ||
- Fix a bug where calls to `$imports.$add` were added to the top-level of the | ||
module but were not statements. This invalid output caused problems when the | ||
plugin was used together with some other Babel plugins | ||
## [1.5.0] - 2019-05-13 | ||
@@ -10,0 +16,0 @@ |
18
index.js
@@ -50,10 +50,12 @@ "use strict"; | ||
function createAddImportCall(alias, source, symbol, value) { | ||
return t.callExpression( | ||
t.memberExpression(t.identifier("$imports"), t.identifier("$add")), | ||
[ | ||
t.stringLiteral(alias), | ||
t.stringLiteral(source), | ||
t.stringLiteral(symbol), | ||
value | ||
] | ||
return t.expressionStatement( | ||
t.callExpression( | ||
t.memberExpression(t.identifier("$imports"), t.identifier("$add")), | ||
[ | ||
t.stringLiteral(alias), | ||
t.stringLiteral(source), | ||
t.stringLiteral(symbol), | ||
value | ||
] | ||
) | ||
); | ||
@@ -60,0 +62,0 @@ } |
{ | ||
"name": "babel-plugin-mockable-imports", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"description": "Babel plugin for mocking ES imports", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
37548
554