Skip to content

Releases: robertknight/babel-plugin-mockable-imports

v2.0.1

25 Aug 12:02
Compare
Choose a tag to compare
  • Fix warning about $imports not being registered with Babel's scope tracker, when using this plugin together with Babel's TypeScript support #75.

Convert package to ES module

01 Nov 22:58
Compare
Choose a tag to compare

This plugin and its runtime helpers have been converted to ES modules. You will need a version of Node and other tooling that supports ESM to use it.

v1.8.0...v2.0.0

v1.8.0

02 Oct 11:57
Compare
Choose a tag to compare
  • Ignore imports added by @rollup/plugin-babel by default and support regex patterns
    in excludeImportsFromModules #52

  • Fix excludeImportsFromModules not working with ES imports #49

v1.7.1

18 Feb 10:04
Compare
Choose a tag to compare

Bug fixes:

  • Handle identifier for import being renamed by another plugin 1252a24

v1.7.0...vpatch

Add support for selectively restoring mocks

01 Feb 15:04
Compare
Choose a tag to compare
  • Add support for selectively restoring mocks by passing an argument to $restore (PR). See README for details.

v1.6.0...v1.7.0

Support CommonJS imports of specific properties

20 Jan 16:26
Compare
Choose a tag to compare

Add support for mocking CommonJS imports of specific properties in one of the following forms:

var foo = require("foo").exportName;

var foo = require("foo")["exportName"];

var foo;
foo = require("foo").exportName;

var foo;
foo = require("foo")["exportName"];

v1.5.2

04 Nov 17:03
Compare
Choose a tag to compare

This release fixes a minor bug with handling of functions passed to $imports.$mock. See #16.

v1.5.1

29 May 00:02
Compare
Choose a tag to compare

This release fixes a bug in the generated code that could break other Babel plugins (eg. babel-plugin-transform-async-to-promises) under certain circumstances.

  • (fix) Make generated $imports.$add(...) calls statements d1e8382

v1.5.0...v1.5.1

v1.5.0

13 May 00:16
Compare
Choose a tag to compare
  • Support passing a function to $mock to semi-automatically mock imports
    based on the source, symbol name or original value
    (#14)
  • Add example projects in JavaScript and TypeScript

v1.4.0

08 May 11:08
Compare
Choose a tag to compare
  • Ignore auto-generated CommonJS imports 8688839

v1.3.1...v1.4.0