Typings issue since @types/jasmine update
See original GitHub issueSince the release of @types/jasmine@2.5.46
I have this issue while running my protractor tests with typescript:
[18:37:17] E/launcher - Error: TSError: ⨯ Unable to compile TypeScript
e2e/app.e2e-spec.ts (19,45): Argument of type '"Hello world !"' is not assignable to parameter of type 'Expected<Promise<string>>'. (2345)
This trace back to this code:
expect(page.getParagraphText()).toEqual('Hello world !');
In the new jasmine types, the expect
typings are now enforced (it wasn’t the case before).
It seems that the protractor jasmine overrides that wait for Promises to resolve before performing the match needs to extends the typings for this to work correctly.
Bug report
- Node Version:
6.x
- Protractor Version:
5.x
- Angular Version:
2.x
- Browser(s):
PhantomJS
- Operating System and Version
osx 10.12.11
Issue Analytics
- State:
- Created 6 years ago
- Reactions:22
- Comments:10 (2 by maintainers)
Top Results From Across the Web
typescript - Error - node_modules\@types\jasmine\index.d.ts ...
If you are still having the issue, in package.json add. "typescript": "^2.9.2". Run npm install. It should work.
Read more >@types/jasmine-jquery - npm
Start using @types/jasmine-jquery in your project by running `npm i @types/jasmine-jquery`. ... Last updated: Thu, 13 May 2021 18:01:29 GMT ...
Read more >DefinitelyTyped/DefinitelyTyped - Gitter
I'm getting. ERROR in ../node_modules/@types/jasmine/ts3.1/index.d.ts:619:15 - error TS2430: Interface 'FunctionMatchers<Fn>' incorrectly extends interface ...
Read more >Cannot find name 'describe' Error in TypeScript | bobbyhadz
... i -D @types/jasmine` and make sure to add the typings for the package in ... If you are still getting the error...
Read more >TypeScript configuration - Angular
typings, TypesScript declaration files. ... After installing @types/* declarations, you have to update the tsconfig.app.json and tsconfig.spec.json files to ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
expect( to expect<any>(
its worked for me
@ChristianStornowski Thanks, I found why it wasn’t working!
I’m using
angular-cli
and the default e2epackage.json
config has:changing it to:
make it work!