Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does tsconfig.spec.json do?

I have seen this and this posts and they have made me understand tsconfig.app.json and tsconfig.json.

I have an angular app which has tsconfig.app.json, tsconfig.json and tsconfig.spec.json

What is the role of tsconfig.spec.json? What does the 'spec' in tsconfig.spec.json stand for?

like image 760
YulePale Avatar asked Jun 27 '20 09:06

YulePale


People also ask

What is Tsconfig spec json for?

Similarly, the tsconfig. spec. json file is used for testing and sets "types": ["jasmine"] to allow using Jasmine's ambient declarations in tests.

What is Spec json?

json description. name. Specifies the name of the extension. The name can contain alphanumeric characters, underscores ( _ ), and spaces ( ).


1 Answers

It is TypeScript configuration for the application tests.

For example below code you says

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

I will use jasmine for testing on nodejs environment.

{
  "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"
  ]
}
like image 80
mr. pc_coder Avatar answered Nov 11 '22 17:11

mr. pc_coder