2

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?

1
  • ng build build an application to the dist folder. ng test runs the unit tests you have coded. The two don't overlap. It's either one, or the other. If you run ng build as a part of you CI/CD process, it will not include unit tests in the output. Commented May 14, 2018 at 21:28

1 Answer 1

2

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"] 
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.