Standard vanilla project created by angular-cli master fails to run build-in tests
Please provide us with the following information:
OS?
MacOS Sierra
Versions.
Please run
ng --version. If there's nothing outputted, please run in a Terminal:node --versionand paste the result here:
Using latest pull from master friday 30. september:
angular-cli: local (v1.0.0-beta.16, branch: master) node: 6.5.0 os: darwin x64
Repro steps.
Was this an app that wasn't created using the CLI? What change did you do on your code? etc.
ng create demoproject
cd demoproject
npm link angular-cli
ng test
The log given by the failure.
~/tmp/demoproject: ng test 30 09 2016 08:58:24.698:WARN [karma]: No captured browser, open http://localhost:9876/
ERROR in ./src/test.ts
Module parse failed: /Users/xxx/tmp/demoproject/src/test.ts Unexpected token (11:8)
You may need an appropriate loader to handle this file type.
|
| // Unfortunately there's no typing for the __karma__ variable. Just declare it as any.
| declare var karma: any;
| declare var require: any;
|
30 09 2016 08:58:24.708:INFO [karma]: Karma v1.2.0 server started at http://localhost:9876/
30 09 2016 08:58:24.709:INFO [launcher]: Launching browser Chrome with unlimited concurrency
30 09 2016 08:58:24.715:INFO [launcher]: Starting browser Chrome
30 09 2016 08:58:25.703:INFO [Chrome 53.0.2785 (Mac OS X 10.12.0)]: Connected on socket /#vqUujfw6DjL32m7FAAAA with id 3870242
30 09 2016 08:58:25.758:WARN [reporter]: SourceMap position not found for trace: undefined
30 09 2016 08:58:25.759:WARN [reporter]: SourceMap position not found for trace: undefined
Chrome 53.0.2785 (Mac OS X 10.12.0) ERROR
Uncaught Error: Module parse failed: /Users/xxx/tmp/demoproject/src/test.ts Unexpected token (11:8)
You may need an appropriate loader to handle this file type.
|
| // Unfortunately there's no typing for the __karma__ variable. Just declare it as any.
| declare var karma: any;
| declare var require: any;
|
at src/test.ts:71
30 09 2016 08:58:25.759:WARN [reporter]: SourceMap position not found for trace: undefined
Chrome 53.0.2785 (Mac OS X 10.12.0) ERROR
Uncaught Error: Module parse failed: /Users/xxx/tmp/demoproject/src/test.ts Unexpected token (11:8)
You may need an appropriate loader to handle this file type.
|
| // Unfortunately there's no typing for the __karma__ variable. Just declare it as any.
| declare var karma: any;
| declare var require: any;
|
at src/test.ts:71
My tests are also not running at all, but not getting any error output, even when changing the debug/log level
try updating the your npm dependencies, it worked for me.
Just tried with a new project and linked angular-cli, and it runs correctly:
kamik@T460p MINGW64 /D/sandbox/master-proj (master)
$ ng test
09 10 2016 20:58:07.010:WARN [karma]: No captured browser, open http://localhost:9876/
09 10 2016 20:58:07.018:INFO [karma]: Karma v1.2.0 server started at http://localhost:9876/
09 10 2016 20:58:07.020:INFO [launcher]: Launching browser Chrome with unlimited concurrency
09 10 2016 20:58:07.044:INFO [launcher]: Starting browser Chrome
09 10 2016 20:58:08.345:INFO [Chrome 53.0.2785 (Windows 10 0.0.0)]: Connected on socket /#y9Bevx5xHkzd9VZmAAAA with id 18040221
Chrome 53.0.2785 (Windows 10 0.0.0): Executed 3 of 3 SUCCESS (0.178 secs / 0.172 secs)
Does this still happen to you? If so, are you absolutely sure it happens on a brand new project?
upgraded from beta 15 to 17 same error when running ng test. updated all npm deps
Could not start watchman; falling back to NodeWatcher for file system events. Visit http://ember-cli.com/user-guide/#watchman for more info. 12 10 2016 22:44:02.149:WARN [karma]: No captured browser, open http://localhost:9876/
ERROR in ./src/test.ts
Module parse failed: /Users/dasanderl/dev/workspaces/idea/porsche/gitlab/MBB_Test/MBB_CGW_Web/src/main/frontend/src/test.ts Unexpected token (11:8)
You may need an appropriate loader to handle this file type.
|
| // Unfortunately there's no typing for the __karma__ variable. Just declare it as any.
| declare let karma: any;
| declare let require: any;
|
12 10 2016 22:44:02.156:WARN [karma]: Port 9876 in use
12 10 2016 22:44:02.157:INFO [karma]: Karma v1.3.0 server started at http://localhost:9877/
12 10 2016 22:44:02.157:INFO [launcher]: Launching browser Chrome with unlimited concurrency
12 10 2016 22:44:02.166:INFO [launcher]: Starting browser Chrome
12 10 2016 22:44:02.885:INFO [Chrome 53.0.2785 (Mac OS X 10.12.0)]: Connected on socket /#B5UN7OgC7rVH80eFAAAA with id 88557397
12 10 2016 22:44:02.962:WARN [reporter]: SourceMap position not found for trace: undefined
12 10 2016 22:44:02.963:WARN [reporter]: SourceMap position not found for trace: undefined
Chrome 53.0.2785 (Mac OS X 10.12.0) ERROR
Uncaught Error: Module parse failed: /Users/dasanderl/dev/workspaces/idea/porsche/gitlab/MBB_Test/MBB_CGW_Web/src/main/frontend/src/test.ts Unexpected token (11:8)
You may need an appropriate loader to handle this file type.
|
| // Unfortunately there's no typing for the __karma__ variable. Just declare it as any.
| declare let karma: any;
| declare let require: any;
|
at src/test.ts:71
on a new ng project ng test works fine....trying to find the issue
I was having a similar issue, where everything would work as expected when running with my linked version of angular-cli but would break when using the installed version.
In my case, I had webpack 2.1.0-beta.22 installed in my project which was overriding 2.1.0-beta.25 required by angular-cli. Updating my project to 2.1.0-beta.25 fixed the issue, but removing it would likely fix it as well.
Closing issue as inactive,
Regarding linked versions, it's overall a development tool so I wouldn't expect a lot of support for it. If you have dependencies acting odd, best course of action is completely deleting and reinstalling.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.