You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Activity
[-]Wrong jasmine/wd2 typings in Angular 8/9[/-][+]Wrong jasminewd2 typings in Angular 8/9[/+][-]Wrong jasminewd2 typings in Angular 8/9[/-][+]Wrong jasmine/wd2 typings in Angular 8/9[/+]alan-agius4 commentedon Apr 17, 2020
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
feat(@schematics/angular): add solutions style tsconfig structure
angular-automatic-lock-bot commentedon Jun 20, 2020
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.
feat(@schematics/angular): add solutions style tsconfig structure