错误TS2688中的错误:找不到“笑话"的类型定义文件 [英] ERROR in error TS2688: Cannot find type definition file for 'jest'
本文介绍了错误TS2688中的错误:找不到“笑话"的类型定义文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个angular 6应用程序,并且正在使用业力+茉莉花运行我的测试.但是当我运行ng test
时,出现以下错误:
I have an angular 6 application and I'm using karma + jasmine to run my tests. but when I run ng test
I'm getting the following error:
错误TS2688中的错误:找不到'jest'的类型定义文件.
ERROR in error TS2688: Cannot find type definition file for 'jest'.
有人知道如何解决这个问题吗?
Any one knows how to solve this problem?
推荐答案
我没有意识到在我的tsconfig.spec.json
中,我在types
节点中使用的是jest
而不是jasmin
.另外,我的配置丢失了.
I didn't realized that in my tsconfig.spec.json
I was using jest
instead of jasmin
in types
node. Also, I had a missing configuration.
因此,我对此进行了更改:
So, I have changed from this:
{
"extends": "./tsconfig.es5.json",
"compilerOptions": {
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"outDir": "../out-tsc/spec",
"module": "commonjs",
"target": "es6",
"baseUrl": "",
"types": [
"jest",
"node"
]
},
"files": [
"**/*.spec.ts"
]
}
对此:
{
"extends": "./tsconfig.es5.json",
"compilerOptions": {
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"outDir": "../out-tsc/spec",
"module": "commonjs",
"types": [
"jasmine",
"node"
]
},
"files": [
"test.ts",
"polyfills.ts"
],
"include": [
"**/*.spec.ts",
"**/*.d.ts"
]
}
此更改解决了我的问题.
And this changes solves my problem.
这篇关于错误TS2688中的错误:找不到“笑话"的类型定义文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文