Currently running karma 4.0.1, webpack 4.31.0, angular 1.6.8, karma-jasmine 2.0.1, jasmine-core 3.4.0
Recently at my workplace, I transitioned our angularjs application from a traditional gulp build process to webpack + es6. The journey has been smooth with minor obstacles until now.
Despite all tests passing successfully in Karma, the tool exits with code 1 and throws an error without specifying the filename or line number for investigation purposes.
I've spent the last couple of days searching online and trying out different approaches but have not achieved any success yet. Any guidance would be greatly appreciated.
14 05 2019 13:27:49.456:INFO [karma-server]: Karma v4.0.1 server started at http://0.0.0.0:10002/
14 05 2019 13:27:49.457:INFO [launcher]: Launching browsers ChromeHeadless-C with concurrency unlimited
14 05 2019 13:27:49.528:INFO [launcher]: Starting browser ChromeHeadless
14 05 2019 13:27:50.081:INFO [HeadlessChrome 74.0.3729 (Mac OS X 10.14.4)]: Connected on socket U30VLDHr805gOx4vAAAA with id 50392440
HeadlessChrome 74.0.3729 (Mac OS X 10.14.4) ERROR
{
"message": "An error was thrown in afterAll\nSyntaxError: Unexpected string",
"str": "An error was thrown in afterAll\nSyntaxError: Unexpected string"
}
HeadlessChrome 74.0.3729 (Mac OS X 10.14.4): Executed 1964 of 1964 ERROR (11.787 secs / 0 secs)
npm debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/Users/riegersn/.nvm/versions/node/v8.9.4/bin/node',
1 verbose cli '/Users/riegersn/.nvm/versions/node/v8.9.4/bin/npm',
1 verbose cli 'run',
1 verbose cli 'test' ]
2 info using <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6d031d002d5b4358435d">[email protected]</a>
3 info using <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="402e2f24250036786e796e74">[email protected]</a>
4 verbose run-script [ 'pretest', 'test', 'posttest' ]
5 info lifecycle <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="85f3f5eaf2e0f7a8f0ecc5b1abbcabb5">[email protected]</a>~pretest: <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="2d5b5d425a485f0058446d190314031d">[email protected]</a>
...
<h3>karma.conf.js</h3>
<pre class="lang-js"><code>var webpackConfig = require('./webpack.config.js')({ development: true});
...
});
};
webpack.config.js
const webpack = require('webpack');
...
return config;
};