It looks like there is no support for babelPreprocessor's filename and sourceFileName. I have a project where the es6 files have extension '.es6'. When I babel before testing, I convert the es6 extension to a js extension using babelPreprocessor's filename. I have a filesystem:
TestBabelIstanbul
- src
-- basicFile.es6 <- file to be tested, in es6
- test
-- basicFile.spec.js <- test file, in es5
- Gruntfile.js
- karma.config.js
- package.json
- test-main.js <- requirejs setup for test
24 07 2017 08:07:37.960:ERROR [coverage]: { Error: ENOENT: no such file or directory, open 'C:\XXXX\TestBabelIstanbul\src\basicFile.js'
at Error (native)
at Object.fs.openSync (fs.js:640:18)
at Object.fs.readFileSync (fs.js:508:33)
at LookupStore.get (C:\XXXX\TestBabelIstanbul\node_modules\istanbul\lib\store\fslookup.js:40:19)
at HtmlReport.writeDetailPage (C:\XXXX\TestBabelIstanbul\node_modules\istanbul\lib\report\html.js:411:67)
at C:\XXXX\TestBabelIstanbul\node_modules\istanbul\lib\report\html.js:489:26
at SyncFileWriter.writeFile (C:\XXXX\TestBabelIstanbul\node_modules\istanbul\lib\util\file-writer.js:57:9)
at FileWriter.writeFile (C:\XXXX\TestBabelIstanbul\node_modules\istanbul\lib\util\file-writer.js:147:23)
at C:\XXXX\TestBabelIstanbul\node_modules\istanbul\lib\report\html.js:488:24
at Array.forEach (native)
at HtmlReport.writeFiles (C:\XXXX\TestBabelIstanbul\node_modules\istanbul\lib\report\html.js:482:23)
at C:\XXXX\TestBabelIstanbul\node_modules\istanbul\lib\report\html.js:484:22
at Array.forEach (native)
at HtmlReport.writeFiles (C:\XXXX\TestBabelIstanbul\node_modules\istanbul\lib\report\html.js:482:23)
at HtmlReport.writeReport (C:\XXXX\TestBabelIstanbul\node_modules\istanbul\lib\report\html.js:566:14)
at LcovReport.writeReport (C:\XXXX\TestBabelIstanbul\node_modules\istanbul\lib\report\lcov.js:55:19)
at writeReport (C:\XXXX\TestBabelIstanbul\node_modules\karma-coverage\lib\reporter.js:68:16)
at C:\XXXX\TestBabelIstanbul\node_modules\karma-coverage\lib\reporter.js:296:11
at C:\XXXX\TestBabelIstanbul\node_modules\karma\lib\helper.js:145:7
at C:\XXXX\TestBabelIstanbul\node_modules\graceful-fs\polyfills.js:287:18
at FSReqWrap.oncomplete (fs.js:123:15)
It looks like there is no support for babelPreprocessor's filename and sourceFileName. I have a project where the es6 files have extension '.es6'. When I babel before testing, I convert the es6 extension to a js extension using babelPreprocessor's filename. I have a filesystem:
src/basicFile.js:
test/basicFile.spec.js
karma.conf.js
Running karma, I get a coverage error:
However, if I change the file extension for basicFile.es6 to '.js' instead of '.es6' it works correctly. Updated karma conf:
Is there a step I'm missing to support this extension change? If not can support be added for babelPreprocessor's filename & sourceFileName?