Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mspace opened this issue Apr 17, 2020 · 2 comments · Fixed by #17586
Closed

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

mspace opened this issue Apr 17, 2020 · 2 comments · Fixed by #17586

Comments

@mspace
Copy link

mspace commented Apr 17, 2020

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.

@mspace mspace changed the title Wrong jasmine/wd2 typings in Angular 8/9 Wrong jasminewd2 typings in Angular 8/9 Apr 17, 2020
@mspace mspace changed the title Wrong jasminewd2 typings in Angular 8/9 Wrong jasmine/wd2 typings in Angular 8/9 Apr 17, 2020
@alan-agius4 alan-agius4 transferred this issue from angular/angular Apr 17, 2020
@alan-agius4
Copy link
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

@alan-agius4 alan-agius4 self-assigned this Apr 17, 2020
@ngbot ngbot bot added this to the needsTriage milestone Apr 17, 2020
@alan-agius4 alan-agius4 added the freq1: low Only reported by a handful of users who observe it rarely label Apr 17, 2020
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Apr 17, 2020
mgechev pushed a commit that referenced this issue May 20, 2020
In version 3.9, TypeScript introduced the concept of "Solutions Style" tsconfig to improve developer experience.

More info: https://devblogs.microsoft.com/typescript/announcing-typescript-3-9-rc/#solution-style-tsconfig

Closes #17493 and closes #8138
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jun 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants