1

I am using test cases in angular 4 for the frontend. But whenever I do any change in the file, it does not reflect automatically. I need to run "ng test" command after every change that is consuming so much time. Please tell me any way, so that after every change I reload automatically.

It works well with the same code in window machine. But not working in ubuntu machine. I am using Linux.

Thanks,

rohit13807
  • 605
  • 8
  • 19

1 Answers1

1

You can run your test with --watch flag. i.e. ng test --watch

--watch

Run build when files change.

If you are using angular cli 1.x, for more options read here

If you are using angular cli 6.x, for more options read here

Community
  • 1
  • 1
Bunyamin Coskuner
  • 8,719
  • 1
  • 28
  • 48
  • Thanks, @Bunyamin, for your attention. It does not work. I am using @angular/cli: 1.0.0 node: 8.0.0 os: linux x64 @angular/animations: 4.0.3 @angular/common: 4.0.2 @angular/compiler: 4.0.2 @angular/core: 4.0.2 @angular/forms: 4.0.2 @angular/http: 4.0.2 @angular/platform-browser: 4.0.2 @angular/platform-browser-dynamic: 4.0.2 @angular/router: 4.0.2 @angular/cli: 1.0.0 @angular/compiler-cli: 4.0.2 – rohit13807 May 31 '18 at 06:54
  • Try updating your angular-cli to later versions of 1.x. Do not update to 6.x, it may break your application. – Bunyamin Coskuner May 31 '18 at 06:55
  • Try updating to v1.4.9. It's the latest version that supports Angular v4. When angular v5 came out, they published angular cli v1.5. Since you are using Angular v4, it may cause some problems. – Bunyamin Coskuner May 31 '18 at 07:10
  • But, my same code is working in window machine. It's not working in Linux machine. – rohit13807 May 31 '18 at 07:15
  • Okay, you did not mention that in your question. Could you please update your question? Now, that's something else to resolve. – Bunyamin Coskuner May 31 '18 at 07:15