小编Sha*_*aed的帖子

当测试/** 未包含在 tsconfig 中时,Vscode TS 语言功能不可用

我希望我的打字稿测试在test文件夹与src. 我不希望在构建打字稿项目时转换测试。

我的打字稿节点项目的结构如下:

.    
??? server
?   ? 
?   ?    
?   ??? src
?   ?   ?
?   ?   ??? app.ts
?   ??? test
?   ?   ?
?   ?   ??? app.test.ts
?   ??? node_modules/
?   ??? package-lock.json
?   ??? package.json
?   ??? tslint.json
?   ??? tsconfig.json
??? front_end/
??? README.md
Run Code Online (Sandbox Code Playgroud)

使用我的 tsconfig:

{
  "compilerOptions": {
    "baseUrl": ".",
    "module": "commonjs",
    "moduleResolution": "node",
    "outDir": "dist",
    "sourceMap": true,
    "strict": true,
    "target": "ESNext",
    "paths": {
      "*": ["node_modules/*"]
    }
  },
  "include": ["src/**/*"] …
Run Code Online (Sandbox Code Playgroud)

typescript jestjs visual-studio-code ts-jest

4
推荐指数
1
解决办法
1298
查看次数

标签 统计

jestjs ×1

ts-jest ×1

typescript ×1

visual-studio-code ×1