ng test SyntaxError: Functions cannot be declared in a nested block in strict mode
Please provide us with the following information:
OS?
Mac OS
Versions.
1.0.0-beta.22-1
Repro steps.
run ng test
The log given by the failure.
PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR SyntaxError: Functions cannot be declared in a nested block in strict mode at webpack:///Users/..../applications/myapp/~/@angular/compiler/src/jit/compiler.js:265:0 <- src/test.ts:51172
Mention any other details that might be useful.
Use "karma-phantomjs-launcher": "^1.0.2" browsers: ['PhantomJS'] Angular 2 , v 2.3.0
Thanks! We'll be in touch soon.
I would guess this is a coding error rather than a problem with the CLI. Does ng test run if you disable/comment out all your spec files?
Yes I did, I disabled all tests as my first step. Same error. In addition it works if I use browsers: ['Chrome'] in karma.conf.js if I switch to browsers: ['PhantomJS'] it does not
Also it works fine with browsers: ['PhantomJS'] if I use Angular 2.2.4 (vs. 2.3.0). Looks like Angular 2.3.0 does not work with browsers: ['PhantomJS']
See the corresponding issue - https://github.com/angular/angular/issues/13301 .
Closing as this is not a CLI specific issue, but an issue with Angular and PhantomJS. See https://github.com/angular/angular/issues/13301
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.