-
Notifications
You must be signed in to change notification settings - Fork 12k
Running test using PhantomJS is failing with RC.0 #5065
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
Comments
The issue is the new tsconfig.spec.json, what gets generated for a brand new project is:
to get it to run with PhantomJS and Chrome I made the following changes:
I had to add, "dom" to the lib. hope this helps someone. Is these changes by design? or is PhantomJS is not intended to work with the CLI? |
Beside the above change @daBishMan made, I also modified |
Weird, I did what you guys did, but I still get this error: Any ideas? There is another Thread here which is kind of similar. |
@DjolePetrovic I assume you are using angular v4.x ( |
@royling Yes, that's correct. Well at least I've moved my old project to CLI rc0 and angular 4 rc1. |
Having the same issue here, using Also have: ...
"karma-phantomjs-launcher": "^1.0.2",
"phantomjs-prebuilt": "^2.1.14",
... Enabled all imports in
Not sure where to go from there? Creating it manually with the content posted above by @daBishMan didn't help |
If I have another monitor, I never mind using Chrome:) The sad story is I only have one monitor for my laptop, so I changed my test browser to phantomjs but meet the same issue as @DjolePetrovic . My system is Angular 2 + ts 2.0. Thank you, @daBishMan and @royling , after I applied both your methods now it could pass npm test without any issue. |
My problem got solved with angular 4 rc2. Update the version and try again. |
Fixed by #5255 |
Hi, I'm experiencing this issue, on latest angular-cli and angular 4, with latest PhantomJS. I have tried setting "target": "es5" etc in tsconfig.spec.json etc, nothing works. Any advice, or is this a regression? Let me know if I should open a new issue. UPDATE: Seems to be an issue with referencing dependent packages by their built JS. The fails are in custom npm packages I'm maintaining. If I specifically reference the .TS source rather than the built JS in the packages in my import statements, the problem goes away. Thanks, |
Hi, UPDATE: {
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": { "ejected": true },
"apps": [{
"root": "src",
"polyfills": "polyfills.ts",
"test": "test.ts",
"testTsconfig": "tsconfig.spec.json"
}]
} My src folder had only |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
OS?
Versions.
@angular/cli: 1.0.0-rc.0
node: 7.5.0
os: win32 x64
@angular/common: 2.4.8
@angular/compiler: 2.4.8
@angular/core: 2.4.8
@angular/forms: 2.4.8
@angular/http: 2.4.8
@angular/platform-browser: 2.4.8
@angular/platform-browser-dynamic: 2.4.8
@angular/router: 3.4.8
@angular/cli: 1.0.0-rc.0
@angular/compiler-cli: 2.4.8
Repro steps.
$ ng test -browsers PhantomJS
27 02 2017 09:16:38.148:WARN [karma]: No captured browser, open http://localhost:9876/
27 02 2017 09:16:38.158:INFO [karma]: Karma v1.4.1 server started at http://0.0.0.0:9876/
27 02 2017 09:16:38.158:INFO [launcher]: Launching browser PhantomJS with unlimited concurrency
27 02 2017 09:16:38.614:INFO [launcher]: Starting browser PhantomJS
27 02 2017 09:16:42.636:INFO [PhantomJS 2.1.1 (Windows 8 0.0.0)]: Connected on socket FxslPlobVmqXyCu-AAAA with id 90654741
PhantomJS 2.1.1 (Windows 8 0.0.0) ERROR
SyntaxError: Use of reserved word 'class'
at webpack:///src/app/shared/models/search-params.model.ts:4:0 <- src/test.ts:6252
PhantomJS 2.1.1 (Windows 8 0.0.0) ERROR
SyntaxError: Use of reserved word 'class'
at webpack:///src/app/shared/models/search-params.model.ts:4:0 <- src/test.ts:6252
PhantomJS 2.1.1 (Windows 8 0.0.0): Executed 0 of 0 ERROR (0.862 secs / 0 secs)
Chrome 56.0.2924 (Windows 10 0.0.0): Executed 291 of 291 SUCCESS (10.092 secs / 9.985 secs)
TOTAL: 291 SUCCESS
The log given by the failure.
Mention any other details that might be useful.
This only happens if you are running using PhantomJS
The text was updated successfully, but these errors were encountered: