【问题标题】:What does tsconfig.spec.json do?tsconfig.spec.json 有什么作用?
【发布时间】:2020-06-27 09:24:24
【问题描述】:

我看过thisthis的帖子,他们让我理解tsconfig.app.jsontsconfig.json

我有一个有 tsconfig.app.jsontsconfig.jsontsconfig.spec.json 的 Angular 应用程序

tsconfig.spec.json的作用是什么? tsconfig.spec.json 中的'spec' 代表什么?

【问题讨论】:

  • 测试用。
  • 我相信“规范”是规范的缩写。这个想法——据我所知——是一个包的测试应该检查规范(需求/要求/期望/deliberables的编纂版本)是否得到满足。

标签: angular typescript tsconfig


【解决方案1】:

这是应用程序测试的 TypeScript 配置。

例如下面你说的代码

"types": ["jasmine", "node"]

我将使用 jasmine 在 nodejs 环境中进行测试。

{
  "extends": "../tsconfig.json",
  "compilerOptions": {
    "outDir": "../out-tsc/spec",
    "module": "commonjs",
    "target": "es5",
    "baseUrl": "",
    "types": [
      "jasmine",
      "node"
    ]
  },
  "files": [
    "test.ts",
    "polyfills.ts"
  ],
  "include": [
    "**/*.spec.ts",
    "**/*.d.ts"
  ]
}

【讨论】:

    猜你喜欢
    • 2023-03-23
    • 2023-04-10
    • 2011-07-17
    • 2014-09-13
    • 2011-12-30
    • 1970-01-01
    • 2019-04-26
    • 2016-04-29
    • 2017-03-02
    相关资源
    最近更新 更多