question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Typings issue since @types/jasmine update

See original GitHub issue

Since 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:open
  • Created 6 years ago
  • Reactions:22
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

32reactions
raghulrajnklcommented, Jun 14, 2017

expect( to expect<any>(

its worked for me

18reactions
sinediedcommented, Jun 23, 2017

@ChristianStornowski Thanks, I found why it wasn’t working!

I’m using angular-cli and the default e2e package.json config has:

    "types": [
      "jasmine",
      "node"
    ]

changing it to:

    "types": [
      "jasmine",
      "jasminewd2",
      "node"
    ]

make it work!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found