Closed dmackerman closed 8 years ago
EDIT: My mistake, read your code wrong.
One for coverage, one for just tests. Cov is pretty slow, so I rarely run it
Hmm, it appears that my code isn't being transpiled. I get warnings like:
WARNING in ./test/about/about.spec.js
Module parse failed: /Users/dave/Sites/ionic-seed/node_modules/babel-loader/index.js!/Users/dave/Sites/ionic-seed/test/about/about.spec.js Line 1: Unexpected token
You may need an appropriate loader to handle this file type.
| import AboutController from './about.controller';
|
| describe('About Component', () => {
@ ./test \.spec\.js$
But I thought the Babel loader was handling those...
If you are using babel6 (I reckon you do), you need presets. es2015
at least. And add it to .babelrc
or package.json
. See babel site for reference. Or esnext-quickstart
for working configs.
excluding in webpack, yours is the only expression that worked!
/(tests|node_modules|\.spec\.ts$)/
I got this working, but the coverage is showing my transpiled sources. I've spent hours trying to figure out which modules to use to get the ES6 code to be shown by Istanbul.
Do I need something like
isparta-loader
? I tried plugging it in as apreLoader
, but no dice.My
karma.config
My
tests.webpack.js
is my single entry point.