相关疑难解决方法(0)

如何使用不同的 tsconfig 文件进行测试?

在我的项目中,我使用了 2 个不同的 tsconfig 文件

  • tsconfig.json
  • tsconfig.specs.json - 用于检测

我如何告诉 Intellij Idea 同时使用两者?
即在Settings- Langauges & Frameworks-TypeScript我可以在不同的Compile scopes之间切换,但Options不是每个编译范围(但每个项目只有一次)。

笔记:

在此处输入图片说明

intellij-idea typescript

5
推荐指数
1
解决办法
408
查看次数

当测试/** 未包含在 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
查看次数