Skip to content

Not working with ember-cli-babel@^7.1.0 #189

Closed

Description

@scottkidder

I just noticed our coverage has been reporting as 100% 0/0 lines. It appears this all started when our projects upgraded to ember-cli-babel@^7.1.0 from ember-cli-babel@^6.17.0

Activity

  1. RobbieTheWagner commented on Sep 9, 2018

    @RobbieTheWagner
    Collaborator

    Hi @scottkidder could you try 1.0.0-beta.5 please?

  2. scottkidder commented on Sep 11, 2018

    @scottkidder
    Author

    Hi @rwwagner90 I have tried 1.0.0-beta.5 and am still seeing the same results.

  3. RobbieTheWagner commented on Sep 11, 2018

    @RobbieTheWagner
    Collaborator

    @adamjmcgrath any ideas on this? I don't have a ton of time to investigate this right now.

  4. scottkidder commented on Sep 12, 2018

    @scottkidder
    Author

    @rwwagner90 I made a minimal reproduction repo here

    Working until ember-cli-babel gets upgraded to ^7.1.0

  5. adamjmcgrath commented on Sep 18, 2018

    @adamjmcgrath
    Collaborator

    Looks like the coverage path property has changed from relative to absolute for the instrumented code. When I have a moment I'll take a look.

    ember-cli-babel: 7.1.1

    // dist/assets/ec-no-cov.js
    define("ec-no-cov/app", ["exports", "ec-no-cov/resolver", "ember-load-initializers", "ec-no-cov/config/environment"], function (_exports, _resolver, _emberLoadInitializers, _environment) {
      "use strict";
    
      var cov_1nj1yxatwc = function () {
        var path = "/Users/mcgrata/dev/ec-no-cov/ec-no-cov/app.js", // <= absolute
            hash = "aceda19773abf430719bd59512b1572c36e696d7",
            Function = function () {}.constructor,
            global = new Function('return this')(),

    ember-cli-babel: 6.17.0

    // dist/assets/ec-no-cov.js
    ;define('ec-no-cov/app', ['exports', 'ec-no-cov/resolver', 'ember-load-initializers', 'ec-no-cov/config/environment'], function (exports, _resolver, _emberLoadInitializers, _environment) {
      'use strict';
    
      var cov_1n0v6ef48u = function () {
        var path = 'ec-no-cov/app.js', // <= relative
            hash = '8684392c2605c12fa0060f6d3857fafe17ff10b6',
            Function = function () {}.constructor,
            global = new Function('return this')(),
  6. adamjmcgrath commented on Sep 18, 2018

    @adamjmcgrath
    Collaborator

    This has been fixed in babel-plugin-istanbul@5.1.0 - it's just not been released yet

    As a workaround you can do npm install babel-plugin-istanbul@next

  7. scottkidder commented on Sep 21, 2018

    @scottkidder
    Author

    I have tried 1.0.0-beta.6 in my app and in my reproduction repo as well and I am still seeing the same 0/0.

  8. RobbieTheWagner commented on Sep 21, 2018

    @RobbieTheWagner
    Collaborator

    @adamjmcgrath do you know why this would still be broken?

  9. adamjmcgrath commented on Sep 24, 2018

    @adamjmcgrath
    Collaborator

    Ah ok, it still looks like an issue with babel-plugin-istanbul, babel 7 now sets opts.filename to an absolute path (babel/babel#8044), so it needs to change to a relative (module) path - similar to the fix in https://github.com/babel/ember-cli-babel/pull/234/files#diff-168726dbe96b3ce427e7fedce31bb0bcR26

  10. RobbieTheWagner commented on Sep 24, 2018

    @RobbieTheWagner
    Collaborator

    @adamjmcgrath is there a way we can support both babel 6 and 7 or are we forced to choose here?

  11. RobbieTheWagner commented on Sep 25, 2018

    @RobbieTheWagner
    Collaborator

    @adamjmcgrath @kategengler can/should we be supporting both babel 6 and 7 or should we just support 7+ in 1.0+ of this lib?

  12. adamjmcgrath commented on Sep 25, 2018

    @adamjmcgrath
    Collaborator

    The latest ember-cli blueprints still use babel 6 (https://github.com/ember-cli/ember-cli/blob/v3.5.0-beta.1/blueprints/app/files/package.json#L27) so I think it will be a while before most users are on 7

  13. RobbieTheWagner commented on Sep 25, 2018

    @RobbieTheWagner
    Collaborator

    @adamjmcgrath While this is true, we want to make sure we either support both for awhile or cut support for babel 6, I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions