How to disable ng-test execution during prod ng build

I am pretty new to angular-cli based projects.

I have created my angular-cli project. I am wondering is there a way we can disable/enable ng-test execution during ng build --prod. The reason why i need this is, in my CI-CD env (where i am building a Prod release), i don't need npm test or any karma related stuff,where as i need them only in my local testing.

I tried the below options in my .angular-cli.json, but it didn't work either. (a) I tried to comment out test in my .angular-cli.json

  // "test": {
  //   "karma": {
  //     // "config": "./karma.conf.js"
  //   }
  // },

(b) I tried to comment only the karma section

How can i control over test execution in prod build?

Upvotes: 2

Views: 4120

Answers (1)

Christopher Lenoir
Christopher Lenoir

Reputation: 21

Maybe it's a bit late to answer this but I ran in the same conserns and found this solution :

In your "tsonfig.app.json", you could add this line :

"exclude": ["src/test.ts", "**/*.spec.ts"]

Upvotes: 2

Related Questions