sglanzer-deprecated / ember-cli-blanket

Blanket based code coverage for ember-cli projects
MIT License
110 stars 46 forks source link

undefined is not an object using 0.9.8 #161

Open ultimatemonty opened 8 years ago

ultimatemonty commented 8 years ago

using the default config and running ember test is giving me the following error:

not ok 1 PhantomJS 2.1 - Global error: TypeError: undefined is not an object (evaluating 'blanket.options('cliOptions').autostart') at http://localhost:7357/assets/test-loader.js, line 147
    ---
        Log: |
            { type: 'error',
              text: 'TypeError: undefined is not an object (evaluating \'blanket.options(\'cliOptions\').autostart\') at http://localhost:7357/assets/test-loader.js, line 147\n' }

output of ember -v --verbose is

ember-cli: 2.6.2
http_parser: 2.7.0
node: 6.4.0
v8: 5.0.71.60
uv: 1.9.1
zlib: 1.2.8
ares: 1.10.1-DEV
icu: 57.1
modules: 48
openssl: 1.0.2h
os: darwin x64

blanket-options.js is

/* globals blanket, module */

var options = {
    modulePrefix: 'engagement-studio',
    filter: '//.*engagement-studio/.*/',
    antifilter: '//.*(tests|template).*/',
    loaderExclusions: [],
    enableCoverage: true,
    cliOptions: {
        reporters: ['json'],
        autostart: true
    }
};
if (typeof exports === 'undefined') {
    blanket.options(options);
} else {
    module.exports = options;
}

this addon worked for me on an earlier version of ember-cli - not sure if it's ember-cli or something else. I have modified testem,js to include &coverage in the URL but even a standard ember test with no server is crashing.

Unsure how to troubleshoot here - glad to help anyway I can.

TaylorHG commented 8 years ago

I have the same issue in ember-cli 2.7.0

jschilli commented 8 years ago

@ultimatemonty @TaylorHG - weird - I updated to ember-cli 2.70, ran ember new, ember install ember-cli-blanket and ember test - i see a complaint about input sourcemap but the tests run fine

❯ ember -v --verbose
ember-cli: 2.7.0
http_parser: 2.3
node: 0.12.7
v8: 3.28.71.19
uv: 1.6.1
zlib: 1.2.8
modules: 14
openssl: 1.0.1p
os: darwin x64

interesting in #154 that he saw the same and tied to to a node version