Karma – 0 tests completed

Running unit testing with Karma on Google Chrome browser on a Angular 2 application.

No tests were running 😥

SUMMARY:
√ 0 tests completed

In the Chrome window, the console said

Refused to execute script from 'http://localhost:9876/base/src/tests/test.ts?b58784c03c82bb3f722dcb6d25bd26cdf145b12b' because its MIME type ('video/mp2t') is not executable

I found a solution here saying that I just need to add the following line to karma.conf.js

mime: {
'text/x-typescript': ['ts','tsx']
},
Advertisements

3 thoughts on “Karma – 0 tests completed

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s