2

i'm developing an Angular2 app with Typescript and every time i run the Typescript transpiler it creates spec.ts files. They are unit tests for the source files because the convention for Angular2 applications is to have this file for each .ts file.

Since at the moment i don't want to do any test, i would like to temporaly disable the generation of spec.ts files, that are a bit messy to handle with my source files.

Do you know how to do that?

EDIT: here is my tsconfig.json file:

{ "compilerOptions": { "module": "commonjs", "target": "es5", "noImplicitAny": true, "suppressImplicitAnyIndexErrors": true, "outDir": "dist", "rootDir": "./src", "sourceMap": true, "emitDecoratorMetadata": true, "experimentalDecorators": true, "moduleResolution": "node" }, "exclude": [ "typings/main.d.ts", "typings/main", "node_modules" ] } 
1
  • could you show us what your tsconfig.json file looks like? Commented Jul 19, 2016 at 14:04

1 Answer 1

3

You can configure your tsconfig.json file to achieve this. You can specify which files to compile by adding them to the files array or you can tell typescript to exclude a certain file or folder by including it in the exclude array.

Here is the link from the official docs.

But as far as i can tell you can't provide a patter like so: '/**.spec.ts'

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.