E2E tests currently do not compile out of the box
-
I'm submitting a ... [X] bug report [ ] feature request [ ] question about the decisions made in the repository
-
Do you want to request a feature or report a bug?
I want to report a bug.
- What is the current behavior?
Cloning on a mac, everything like described, all the npm scripts work beside tests: The current e2e tests do not compile.
npm run test / npm run e2e / npm run ci
I assume it will be the same for everyone, I started over again for double checking.
- What is the expected behavior?
e2e tests should compile and work out of the box if this is a starter template.
- Please tell us about your environment:
- Angular version: current
- Browser: [does not apply]
- Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)
Error message:
ERROR in [at-loader] src/app/app.e2e.ts:12:29
TS2345: Argument of type 'string' is not assignable to parameter of type 'Expected<Promise<string>>'.
ERROR in [at-loader] src/app/app.e2e.ts:18:29
TS2345: Argument of type 'true' is not assignable to parameter of type 'Expected<Promise<boolean>>'.
ERROR in [at-loader] src/app/app.e2e.ts:24:29
TS2345: Argument of type 'true' is not assignable to parameter of type 'Expected<Promise<boolean>>'.
ERROR in [at-loader] src/app/app.e2e.ts:30:29
TS2345: Argument of type 'string' is not assignable to parameter of type 'Expected<Promise<string>>'.
ERROR in [at-loader] src/app/home/home.e2e.ts:13:29
TS2345: Argument of type 'string' is not assignable to parameter of type 'Expected<Promise<string>>'.
ERROR in [at-loader] src/app/home/home.e2e.ts:19:29
TS2345: Argument of type 'string' is not assignable to parameter of type 'Expected<Promise<string>>'.
Same errors happen at npm run test step
same for me
You can find a solution here: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/14569. Downgrading Jasmine typing version worked for me.
Happened when I updated my angular 2 files as well
Another way to fix this is to change
expect(
to
expect<any>(
Thanks @SebHeuze for your suggestion. This helps me demonstrate to some colleagues learning ng2.
Same issue here, I tried also expect<Promise<boolean>>( instead of expect<any>( but didn't work
Did you tried the other solution in the referenced pull request ? #1640
Fixed by #1691
Another way to fix this is to change
expect(toexpect<any>(
Worked for me!