Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mirage acceptance tests not working with ember-cli-babel includePolyfill enabled #1084

Closed
bsaff opened this issue May 12, 2017 · 8 comments · Fixed by #1088
Closed

Mirage acceptance tests not working with ember-cli-babel includePolyfill enabled #1084

bsaff opened this issue May 12, 2017 · 8 comments · Fixed by #1088

Comments

@bsaff
Copy link

bsaff commented May 12, 2017

So I've got a very interesting error here. My steps:

  • Started a new ember app (ember-cli 2.13.1)
  • Generated an acceptance test for visting '/'.
  • Verified that all tests pass.
  • Installed ember-cli-mirage.
  • Verified all tests still pass.
  • In ember-cli-build.js set babel's includePolyfill setting to true.
  • Run tests

Results: A series of tests break with the following error appearing

not ok 23 PhantomJS 2.1 - Global error: Error:
TypeError: Object is not a constructor (evaluating '(0, _lodash_defineProperty['default'])') at http://localhost:7357/assets/test-support.js, line 6993
    ---
        Log: |
            { type: 'error',
              text: 'Error: \nTypeError: Object is not a constructor (evaluating \'(0, _lodash_defineProperty[\'default\'])\') at http://localhost:7357/assets/test-support.js, line 6993\n' }
@bsaff bsaff changed the title Mirage Acceptance Tests not working with ember-cli-babel IncludePolyfill Mirage acceptance tests not working with ember-cli-babel includePolyfill May 12, 2017
@bsaff bsaff changed the title Mirage acceptance tests not working with ember-cli-babel includePolyfill Mirage acceptance tests not working with ember-cli-babel includePolyfill enabled May 12, 2017
@rwjblue
Copy link
Collaborator

rwjblue commented May 12, 2017

Seems good to have an issue over here also, but I believe this the same as ember-cli/ember-cli#7001 and mike-north/ember-lodash#103.

@bsaff
Copy link
Author

bsaff commented May 12, 2017

I'm not currently testing polyfill-dependent features so I've temporarily disabled polyfill for testing until this issue is resolved. code below:

module.exports = function(defaults) {
  var env = EmberApp.env();
  // enable polyfill as long as we are not testing
  var notTesting = env !== 'test';
  var app = new EmberApp(defaults, {
    'ember-cli-babel': {
      includePolyfill: notTesting
    }
  });
...

@simonihmig
Copy link
Contributor

@bsaff I don't think that workaround is applicable in general. If you don't need the polyfill for PhantomJS, you certainly don't need it for any real browser then. Maybe this is working for you, because your tests are not touching your code that depends on the polypill?

@bsaff
Copy link
Author

bsaff commented May 12, 2017

@simonihmig that's true. currently not testing polyfill-dependent features. I'll make a note

@vmalloc
Copy link

vmalloc commented May 15, 2017

Also hitting this issue. Any news on how to avoid it?

@stefanpenner
Copy link
Collaborator

@vmalloc look slike @rwjblue merged a fixed.

@simonihmig
Copy link
Contributor

This may be needed to get merged as well: mike-north/ember-lodash#105

@fushi
Copy link

fushi commented May 15, 2017

Pretty sure this is a dupe of ember-cli/ember-cli#7001

simonihmig added a commit to simonihmig/ember-cli-mirage that referenced this issue May 17, 2017
samselikoff pushed a commit that referenced this issue May 18, 2017
* Update ember-lodash

Fixes #1084

* Update npm to at least v3 in Travis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants