nwb
nwb copied to clipboard
Can't run tests since imported node modules aren't transpiled
If I do this in a test:
import fetchMock from "fetch-mock";
It will generate this error:
PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR
{
"message": "SyntaxError: Unexpected token 'const'\nat webpack:///node_modules/tr46/index.js:3 <- tests/index-test.js:69813",
"str": "SyntaxError: Unexpected token 'const'\nat webpack:///node_modules/tr46/index.js:3 <- tests/index-test.js:69813"
}
If I change the browser to ChromeHeadless
in nwb.config.js
that solves it and maybe solves it for someone else...
karma: {
browsers: ["ChromeHeadless"]
},
Keeping this open since I am still running into issues and it seems like this should be configurable but not clear how to get it to work ?...