Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

karma-test-shim.js and system.js #1

Open
dknesek opened this issue Jan 20, 2017 · 1 comment
Open

karma-test-shim.js and system.js #1

dknesek opened this issue Jan 20, 2017 · 1 comment

Comments

@dknesek
Copy link

dknesek commented Jan 20, 2017

This is very cool.

I'm new to most of this stuff, and I've run into a problem that I can't solve. I followed your instructions and have started the Angular2 app. It seems to start fine.
However, when I try to run the tests, this is what I get:

(docker) root@2b5024c9aa49:/src/savethecode# npm test
npm info it worked if it ends with ok
npm info using npm@3.10.10
npm info using node@v6.9.4
npm info lifecycle angular2-webpack@1.0.0pretest: angular2-webpack@1.0.0
npm info lifecycle angular2-webpack@1.0.0
test: angular2-webpack@1.0.0
angular2-webpack@1.0.0 test /src/savethecode
gulp i18n-xlf2ts && karma start
[03:02:44] Using gulpfile /src/savethecode/gulpfile.js
[03:02:44] Starting 'i18n-xlf2ts'...
Transpiling XLF translation files to TS...
[03:02:44] Finished 'i18n-xlf2ts' after 79 ms
==> ./src/resources/i18n/messages.en.ts
==> ./src/resources/i18n/messages.es.ts
20 01 2017 03:03:08.558:WARN [watcher]: Pattern "/src/savethecode/config/karma-test-shim.js" does not match any file.
20 01 2017 03:03:08.589:WARN [watcher]: Pattern "/src/savethecode/config/karma-test-shim.js" does not match any file.
webpack: bundle is now VALID.
20 01 2017 03:03:08.668:INFO [karma]: Karma v1.4.0 server started at http://0.0.0.0:9876/
20 01 2017 03:03:08.670:INFO [launcher]: Launching browser PhantomJS with unlimited concurrency
20 01 2017 03:03:09.027:INFO [launcher]: Starting browser PhantomJS
20 01 2017 03:03:10.633:INFO [PhantomJS 2.1.1 (Linux 0.0.0)]: Connected on socket NvcqWBXAr24l5ou-AAAA with id 86578905
PhantomJS 2.1.1 (Linux 0.0.0): Executed 0 of 0 ERROR (0.026 secs / 0 secs)
npm info lifecycle angular2-webpack@1.0.0~test: Failed to exec test script
npm ERR! Test failed. See above for more details.

So I copied in karma-test-shim.js. This has a dependency on system.js, which I installed into the Dockerfile and added to the root package.json. Now Phantom.js is complaining that it can't find system.js:

PhantomJS 2.1.1 (Linux 0.0.0) ERROR
ReferenceError: Can't find variable: System
at webpack:///config/karma-test-shim.js:27:0 <- config/karma-test-shim.js:73

I'm assuming there's a way to make sure Phantom.js can find it, but I don't know how, and I would rather not start guessing.

Can you please look into this and perhaps update your code in GitHub to reflect the necessary updates?

Thanks,
Doug

@alber999
Copy link
Owner

Just released a new version with angular 2.4.8 and webpack 2.2.1. Problem persists yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants