ef4 / ember-browserify

ember-cli addon for easily loading CommonJS packages from npm via browserify.
MIT License
172 stars 28 forks source link

BROWSERIFY_TESTS feature breaks tests when using latest ember #63

Closed asakusuma closed 8 years ago

asakusuma commented 8 years ago

I noticed this while upgrading ember to canary in an application that uses the BROWSERIFY_TESTS flag to import npm modules in a test file.

I was able to reproduce this in a sample addon.

Still working on figuring out the root cause.

not ok 1 PhantomJS 1.9 - Global error: Error: Could not find module `ember-qunit` imported from `dummy/tests/test-helper` at http://localhost:7357/assets/vendor.js, line 144
    ---
        Log: |
            { type: 'error',
              text: 'Error: Could not find module `ember-qunit` imported from `dummy/tests/test-helper` at http://localhost:7357/assets/vendor.js, line 144\n' }
    ...
not ok 2 PhantomJS 1.9 - Global error: Error: Assertion Failed: The tests file was not loaded. Make sure your tests index.html includes "assets/tests.js". at http://localhost:7357/assets/vendor.js, line 16804
    ---
        Log: |
            { type: 'error',
              text: 'Error: Assertion Failed: The tests file was not loaded. Make sure your tests index.html includes "assets/tests.js". at http://localhost:7357/assets/vendor.js, line 16804\n' }
    ...

1..2
# tests 2
# pass  0
# skip  0
# fail  2
asakusuma commented 8 years ago

The problem is that the browserified code does not have a semicolon at the end. More info in this browserify ticket: https://github.com/substack/node-browserify/issues/806

I'll open a PR