Repository navigation
Closed
Description
I assume this is known, but for tracking purposes:
$ ember -v
ember-cli: 2.13.0-beta.4
node: 6.10.1
os: darwin x64
$ ember new coverage-test
$ cd coverage-test
$ ember install ember-cli-code-coverage
$ COVERAGE=true ember test
...
1..8
# tests 8
# pass 8
# skip 0
# fail 0
# ok
$ echo "module.exports = { useBabelInstrumenter: true };" > config/coverage.js
$ COVERAGE=true ember test
TypeError: The plugin [null,{}] didn't export a Plugin instance
at PluginManager.validate (coverage-test/node_modules/babel-core/lib/transformation/file/plugin-manager.js:164:13)
at PluginManager.add (coverage-test/node_modules/babel-core/lib/transformation/file/plugin-manager.js:213:10)
at File.buildTransformers (coverage-test/node_modules/babel-core/lib/transformation/file/index.js:237:21)
at new File (coverage-test/node_modules/babel-core/lib/transformation/file/index.js:139:10)
at Pipeline.transform (coverage-test/node_modules/babel-core/lib/transformation/pipeline.js:164:16)
at Instrumenter.instrumentSync (coverage-test/node_modules/ember-cli-code-coverage/lib/babel-istanbul-instrumenter.js:36:45)
at CoverageInstrumenter.processString (coverage-test/node_modules/ember-cli-code-coverage/lib/coverage-instrumenter.js:113:25)
at CoverageInstrumenter.processFile (coverage-test/node_modules/broccoli-filter/index.js:165:31)
at asyncProcessFile (coverage-test/node_modules/broccoli-filter/index.js:122:21)
at tryCatch (coverage-test/node_modules/rsvp/dist/rsvp.js:539:12)
Unable to cover: app/resolver.js . Try setting useBabelInstrumenter to true.
TypeError: The plugin [null,{}] didn't export a Plugin instance
at PluginManager.validate (coverage-test/node_modules/babel-core/lib/transformation/file/plugin-manager.js:164:13)
at PluginManager.add (coverage-test/node_modules/babel-core/lib/transformation/file/plugin-manager.js:213:10)
at File.buildTransformers (coverage-test/node_modules/babel-core/lib/transformation/file/index.js:237:21)
at new File (coverage-test/node_modules/babel-core/lib/transformation/file/index.js:139:10)
at Pipeline.transform (coverage-test/node_modules/babel-core/lib/transformation/pipeline.js:164:16)
at Instrumenter.instrumentSync (coverage-test/node_modules/ember-cli-code-coverage/lib/babel-istanbul-instrumenter.js:36:45)
at CoverageInstrumenter.processString (coverage-test/node_modules/ember-cli-code-coverage/lib/coverage-instrumenter.js:113:25)
at CoverageInstrumenter.processFile (coverage-test/node_modules/broccoli-filter/index.js:165:31)
at asyncProcessFile (coverage-test/node_modules/broccoli-filter/index.js:122:21)
at tryCatch (coverage-test/node_modules/rsvp/dist/rsvp.js:539:12)
...
I'm pretty green with Babel and Babel plugins, but if pointed in the right direction I can take a look at making this work!
Reacted by Ming Liu, Dmitri Akatov and Sergey Astapov
Metadata
Metadata
Assignees
Labels
No labels
Activity
ming-codes commentedon May 1, 2017
Ember CLI 2.13 moved to babel 6. Babel plugins works differently in babel 6 and I see
ember-cli-code-coveragedoes uses a babel plugin for transformation. Perhaps this is the reason?rwjblue commentedon May 2, 2017
Thanks for reporting! The issue lies with the fact that we provide
babeloptions from the host app into our custom babel instrumenter (which is based on babel-core@5). Using babel-core@5 as the instrumenter itself is totally fine (though we should also update to babel@6), but passing babel@6 plugins to babel@5 is causing the reported error.[-]Plugin fails with ember-cli 2.13.0-beta.4 and useBabelInstrumenter: true[/-][+]Plugin fails with ember-cli 2.13 and useBabelInstrumenter: true[/+]paulcwatts commentedon May 12, 2017
I've been working on fixing this here: #115. This updates babel-core to 6.x, which seems to make it work using the new ember-cli. However, I don't know how this will affect older versions not upgraded to the latest ember-cli/babel@6.
I still have to have to some real-world testing.
Turbo87 commentedon May 18, 2017
@rwjblue can we use https://github.com/istanbuljs/babel-plugin-istanbul instead?
rwjblue commentedon May 18, 2017
Ya, possibly. I'd have to check, but it seems reasonable.
paulcwatts commentedon May 18, 2017
That definitely looks promising. I will look to see how I can integrate that.
add mocha support and fix pretender bug
template instrumentation (merged master) (#200)
template instrumentation (merged master) (ember-cli-code-coverage#200)