Skip to content

Wrong jasmine/wd2 typings in Angular 8/9 #17493

Description

@mspace

I created a new blank angular 9 project using next commands:

ng new my-app
npm install
ng serve

I added then() to test:

Then run:

ng test

Error occured:

ERROR in src/app/app.component.spec.ts:20:30 - error TS2339: Property 'then' does not exist on type 'boolean'.

20     expect(app).toBeTruthy().then(() => { });
                                ~~~~

After removing "@types/jasminewd2": "~2.0.3", from package.json, deleting then() of course and running:

npm install
ng test // no compilation error

Visual studio code reported that expect() matcher is sync method and returns boolean instead of Promise, just removed the .then() and everything works as it should.

## my environment

**Angular Version:**
Angular CLI: 9.1.1
Node: 12.16.1
OS: win32 x64

Angular: 9.1.2
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.901.1
@angular-devkit/build-angular     0.901.1
@angular-devkit/build-optimizer   0.901.1
@angular-devkit/build-webpack     0.901.1
@angular-devkit/core              9.1.1
@angular-devkit/schematics        9.1.1
@angular/cli                      9.1.1
@ngtools/webpack                  9.1.1
@schematics/angular               9.1.1
@schematics/update                0.901.1
rxjs                              6.5.5
typescript                        3.8.3
webpack                           4.42.0

D:\my-app>node -v
v12.16.1

D:\my-app>npm -v
6.13.4

Not really sure this is an Angular bug, but package @types/jasminewd2 comes by default I suppose.

Activity

  1. changed the title [-]Wrong jasmine/wd2 typings in Angular 8/9[/-] [+]Wrong jasminewd2 typings in Angular 8/9[/+] on Apr 17, 2020
  2. changed the title [-]Wrong jasminewd2 typings in Angular 8/9[/-] [+]Wrong jasmine/wd2 typings in Angular 8/9[/+] on Apr 17, 2020
  3. alan-agius4 commented on Apr 17, 2020

    @alan-agius4
    Collaborator

    The actual problem here is in the IDE, where it's picking up the incorrect typings.

    This is pretty much the same root cause as #8138 and is currently being tracking internal TOOL-1368

  4. self-assigned this
    on Apr 17, 2020
  5. added this to the needsTriage milestone on Apr 17, 2020
  6. added
    freq1: lowOnly reported by a handful of users who observe it rarely
    on Apr 17, 2020
  7. modified the milestones: needsTriage, Backlog on Apr 17, 2020
  8. added a commit that references this issue on May 20, 2020
    bede232
  9. angular-automatic-lock-bot commented on Jun 20, 2020

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  10. locked and limited conversation to collaborators on Jun 20, 2020
  11. added a commit that references this issue on May 29, 2026
    56c0084
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions