PatrickJS-starter icon indicating copy to clipboard operation
PatrickJS-starter copied to clipboard

E2E tests currently do not compile out of the box

Open DanielMarcial opened this issue 9 years ago • 10 comments

  • 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>>'.

DanielMarcial avatar Mar 16 '17 17:03 DanielMarcial

Same errors happen at npm run test step

lanocturne avatar Mar 16 '17 21:03 lanocturne

same for me

mftaha avatar Mar 17 '17 19:03 mftaha

You can find a solution here: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/14569. Downgrading Jasmine typing version worked for me.

moisesisaias avatar Mar 17 '17 19:03 moisesisaias

Happened when I updated my angular 2 files as well

ChrisGarand avatar Mar 22 '17 19:03 ChrisGarand

Another way to fix this is to change expect( to expect<any>(

SebHeuze avatar Mar 23 '17 13:03 SebHeuze

Thanks @SebHeuze for your suggestion. This helps me demonstrate to some colleagues learning ng2.

dmcodesailor avatar Mar 23 '17 20:03 dmcodesailor

Same issue here, I tried also expect<Promise<boolean>>( instead of expect<any>( but didn't work

francoismassart avatar Apr 19 '17 14:04 francoismassart

Did you tried the other solution in the referenced pull request ? #1640

SebHeuze avatar Apr 19 '17 20:04 SebHeuze

Fixed by #1691

colinskow avatar Apr 23 '17 07:04 colinskow

Another way to fix this is to change expect( to expect<any>(

Worked for me!

JackConnor avatar Sep 21 '18 21:09 JackConnor