Angular 89中错误的茉莉花键入法

问题描述 投票:0回答:1

我新建了一个空白的angular 9项目(ng new my-app). 然后运行:npm install,只改了这个。

enter image description here

我添加了 .then() 作为visual studio的代码打字报告,期望匹配器能返回 承诺.

在运行 npm test -> ng test,我得到。

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

26     expect(app.title).toEqual('my-app').then(() => { });
                                           ~~~~

所以我删除了 @typesjasminewd2 从package.json和expect matchers是同步方法,它们不返回promise,而是返回booleans。一切都能正常工作。

enter image description here

我在这里错过了什么?是否有其他人有这个问题。这是开箱即用的,我是说默认设置。

angular jasmine typescript-typings
1个回答
1
投票

这实际上是一个已知的bug,已经由angular cli团队解决。

https:/github.comangularangular-cliissues17493

© www.soinside.com 2019 - 2024. All rights reserved.