Ember-cli: acceptance tests fail when using environment=production

Created on 7 Sep 2017  路  3Comments  路  Source: ember-cli/ember-cli

All acceptance tests fail when running ember test --environment=production

Repro steps:

  1. ember new atest
  2. cd atest
  3. ember g acceptance-test accept-it
  4. ember t --environment=production
not ok 1 Chrome 60.0 - Acceptance | accept it: visiting /accept-it
    ---
        actual: >
            false
        expected: >
            true
        stack: >
            TypeError: (0 , t.classCallCheck) is not a function
                at new n (http://localhost:7357/assets/test-support-8b651c4b2c7db5ef100affa5e4ed91a7.js:150:61)
                at Function.h (http://localhost:7357/assets/vendor-f0919025b3f91f5cb3379a9aa8e642df.js:3303:7)
                at s (http://localhost:7357/assets/test-support-8b651c4b2c7db5ef100affa5e4ed91a7.js:147:106)
                at http://localhost:7357/assets/test-support-8b651c4b2c7db5ef100affa5e4ed91a7.js:98:51
                at e.run (http://localhost:7357/assets/vendor-f0919025b3f91f5cb3379a9aa8e642df.js:1269:32)
                at ke (http://localhost:7357/assets/vendor-f0919025b3f91f5cb3379a9aa8e642df.js:2047:257)
                at n (http://localhost:7357/assets/test-support-8b651c4b2c7db5ef100affa5e4ed91a7.js:155:56)
                at n.helpers.(anonymous function).meta.wait.t (http://localhost:7357/assets/test-support-8b651c4b2c7db5ef100affa5e4ed91a7.js:98:20)
                at Object.<anonymous> (http://localhost:7357/assets/tests-0f376601abc38659f82d0f925ae9f820.js:2:201)
                at e (http://localhost:7357/assets/test-support-8b651c4b2c7db5ef100affa5e4ed91a7.js:275:288)
        message: >
            (0 , t.classCallCheck) is not a function
        Log: |
            { type: 'error',
              text: '\'TypeError: (0 , t.classCallCheck) is not a function\\n    at new n (http://localhost:7357/assets/test-support-8b651c4b2c7db5ef100affa5e4ed91a7.js:150:61)\\n    at Function.h (http://localhost:7357/assets/vendor-f0919025b3f91f5cb3379a9aa8e642df.js:3303:7)\\n    at s (http://localhost:7357/assets/test-support-8b651c4b2c7db5ef100affa5e4ed91a7.js:147:106)\\n    at http://localhost:7357/assets/test-support-8b651c4b2c7db5ef100affa5e4ed91a7.js:98:51\\n    at e.run (http://localhost:7357/assets/vendor-f0919025b3f91f5cb3379a9aa8e642df.js:1269:32)\\n    at ke (http://localhost:7357/assets/vendor-f0919025b3f91f5cb3379a9aa8e642df.js:2047:257)\\n    at n (http://localhost:7357/assets/test-support-8b651c4b2c7db5ef100affa5e4ed91a7.js:155:56)\\n    at n.helpers.(anonymous function).meta.wait.t (http://localhost:7357/assets/test-support-8b651c4b2c7db5ef100affa5e4ed91a7.js:98:20)\\n    at Object.<anonymous> (http://localhost:7357/assets/tests-0f376601abc38659f82d0f925ae9f820.js:2:201)\\n    at e (http://localhost:7357/assets/test-support-8b651c4b2c7db5ef100affa5e4ed91a7.js:275:288)\'\n' }
    ...

Output from ember version --verbose && npm --version && yarn --version:

ember-cli: 2.15.1
http_parser: 2.7.0
node: 6.11.1
v8: 5.1.281.103
uv: 1.11.0
zlib: 1.2.11
ares: 1.10.1-DEV
icu: 58.2
modules: 48
openssl: 1.0.2k
os: darwin x64
3.10.10
0.27.5

Most helpful comment

Confirm. Definitely the same issue.

Basically, what is happening is that we use a shared set of babel helpers that we customize for production builds of Ember itself. However, when we run tests in prod builds we add the ember-testing.js asset to the build which was compiled for debug builds (and hence a different set of babel helpers) than the ones available.

This will need to be fixed in Ember鈥檚 own build system.

All 3 comments

Confirm. Definitely the same issue.

Basically, what is happening is that we use a shared set of babel helpers that we customize for production builds of Ember itself. However, when we run tests in prod builds we add the ember-testing.js asset to the build which was compiled for debug builds (and hence a different set of babel helpers) than the ones available.

This will need to be fixed in Ember鈥檚 own build system.

I believe this is fixed now. Tested with:

ember new foo
cd foo
ember g acceptance-test index
# edit test to pass properly
ember test --environment=production
Was this page helpful?
0 / 5 - 0 ratings