diff --git a/samples/issue109-rewiring-unused-do-not-throw/sample.js b/samples/issue109-rewiring-unused-do-not-throw/sample.js new file mode 100644 index 0000000..3b3e5cb --- /dev/null +++ b/samples/issue109-rewiring-unused-do-not-throw/sample.js @@ -0,0 +1,10 @@ +import { __RewireAPI__ } from './src/main'; +import expect from 'expect.js'; + +describe('rewiring an unused thing', () => { + it('should not throw', () =>{ + expect(() => { + __RewireAPI__.__Rewire__('x', 'ok sure'); + }).to.not.throwException(); + }); +}); diff --git a/samples/issue109-rewiring-unused-do-not-throw/src/main.js b/samples/issue109-rewiring-unused-do-not-throw/src/main.js new file mode 100644 index 0000000..0a86a03 --- /dev/null +++ b/samples/issue109-rewiring-unused-do-not-throw/src/main.js @@ -0,0 +1 @@ +const x = 10; diff --git a/usage-tests/BabelRewirePluginUsageTest.js b/usage-tests/BabelRewirePluginUsageTest.js index a30623c..a434136 100644 --- a/usage-tests/BabelRewirePluginUsageTest.js +++ b/usage-tests/BabelRewirePluginUsageTest.js @@ -77,7 +77,8 @@ var configurations = { 'issue146-revert-function-for-set', 'issue163', 'issue165', - 'issue109' + 'issue109', + 'issue109-rewiring-unused-do-not-throw', ] }, transformSampleCodeToTestWithBabelPluginRewireAndTransformAsyncToGenerator: {