Open dotnetCarpenter opened 8 years ago
Hmm.. Perhaps it is the issue described in this article: http://martinmicunda.com/2015/10/19/how-to-start-writing-unit-tests-with-es6-angular-1x-and-jspm/
Depends on your application file structure you might see 404 error when you run your test. To fix this error you need to proxy your paths to /base/ prefix e.g.:
proxies: { '/test/': '/base/test/', '/src/app/': '/base/src/app/', '/jspm_packages/': '/base/jspm_packages/' }
NOTE: This is bug in karma-jspm and it might be fix in the future so you will not need to proxy anything.
While using proxies, fixes the 404's my issue persist. Does anyone know what goes wrong?
npm test
> danishify@2.0.0 test C:\Users\dotnet\Projects\playground\danishify
> karma start
09 03 2016 14:01:28.091:INFO [karma]: Karma v0.13.22 server started at http://localhost:9876/
09 03 2016 14:01:28.106:INFO [launcher]: Starting browser PhantomJS
09 03 2016 14:01:29.791:INFO [PhantomJS 2.1.1 (Windows 8 0.0.0)]: Connected on socket /#Dl5cayeEZwXpIKclAAAA with id 89243764
PhantomJS 2.1.1 (Windows 8 0.0.0) ERROR: 'Potentially unhandled rejection [3] http://localhost:9876/base/jspm_packages/system.src.js?281591da6090abed69cd0b080aa69c8de089a41c:733:14
tryCatchReject@http://localhost:9876/base/jspm_packages/system-polyfills.src.js?3aa57969dce4ecea4c51aab540f372d15cc886b6:1252:34
runContinuation1@http://localhost:9876/base/jspm_packages/system-polyfills.src.js?3aa57969dce4ecea4c51aab540f372d15cc886b6:1211:18
when@http://localhost:9876/base/jspm_packages/system-polyfills.src.js?3aa57969dce4ecea4c51aab540f372d15cc886b6:1032:20
run@http://localhost:9876/base/jspm_packages/system-polyfills.src.js?3aa57969dce4ecea4c51aab540f372d15cc886b6:890:17
_drain@http://localhost:9876/base/jspm_packages/system-polyfills.src.js?3aa57969dce4ecea4c51aab540f372d15cc886b6:166:22
drain@http://localhost:9876/base/jspm_packages/system-polyfills.src.js?3aa57969dce4ecea4c51aab540f372d15cc886b6:131:15'
09 03 2016 14:01:40.440:WARN [PhantomJS 2.1.1 (Windows 8 0.0.0)]: Disconnected (1 times), because no message in 10000 ms.
npm ERR! Test failed. See above for more details.
I have deep dived into karma-jspm and tried to find a solution but are giving up. I get the following error when I run my tests via
karma start
:I'm not able to load any file (and I have tried many different paths). But if I put the same files in the karma config
files
array, they load. But since I use es2015 modules, that doesn't work withoutjspm
.I have the following structure:
My
karma.conf.js
:I use es2015 modules in the test.