24

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?

3

1 Answer 1

23

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" ] } 
Sign up to request clarification or add additional context in comments.

1 Comment

According to typescriptlang.org/tsconfig#types types declaration only describes which ./node_modules/@types/ subfolders are included. The main condition of tsconfig.spec.json file is to specify test files in "include": [ "*/.spec.ts" . Is the name tsconfig.spec.json just convention? Can someone use different config file name, e.g. tsconfig.test.json for the same purpose?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.