module default export test
1) should demonstrate the default exported rewire api
2) should demonstrate the rewire apis named export
0 passing (35ms)
2 failing
1) module default export test should demonstrate the default exported rewire api:
TypeError: _get__(...) is not a function
at Context.<anonymous> (specs/data-layer/unit/foo-spec.js:8:7)
2) module default export test should demonstrate the rewire apis named export:
TypeError: _get__(...) is not a function
at Context.<anonymous> (specs/data-layer/unit/foo-spec.js:17:7)
I am attempting to run the demo code for: Handling of default exports.
I am using babel with numerous plugins "babel-cli": "^6.24.0", "babel-core": "^6.9.1", "babel-loader": "^6.2.4", "babel-plugin-istanbul": "^4.1.1", "babel-plugin-lodash": "^3.2.6", "babel-plugin-resolver": "^1.1.0", "babel-plugin-rewire": "^1.0.0", "babel-plugin-transform-es3-member-expression-literals": "6.8.0", "babel-plugin-transform-es3-property-literals": "6.8.0", "babel-plugin-transform-object-rest-spread": "^6.23.0", "babel-preset-es2015": "^6.9.0", "babel-preset-react": "^6.23.0", "babel-register": "^6.11.6", "babelify": "~6.3.0",
foo.js
foo-spec.js import FooModule from './foo.js'; import { foo, RewireAPI as FooModuleRewireAPI } from './foo.js'; const chai = require('chai'); const expect = chai.expect();
The results are:
Please explain what it wrong.