我是量角器打字稿的新手,并且在测试文件中编译时感到头疼。
如您所见,代码中有一个错误(错误TS2582):. ts测试用例中(肯定是以前没有的)。
如何解决该问题,以便可以使用tsc进行编译并成功运行测试用例?
这是代码:
ChaLoctestscript.ts:5:1 - error TS2582: Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i @types/jest
` or `npm i @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.
5 describe('Using chain loctor',function(){
~~~~~~~~
ChaLoctestscript.ts:8:2 - error TS2582: Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `
npm i @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.
8 it('Opening google page',function(){
~~
Found 2 errors.