Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests are not rebuilding #5402

Closed
dagi12 opened this issue Mar 13, 2017 · 6 comments
Closed

Tests are not rebuilding #5402

dagi12 opened this issue Mar 13, 2017 · 6 comments

Comments

@dagi12
Copy link

dagi12 commented Mar 13, 2017

Versions.

1.0.0-rc1

Repro steps.

  • Create new app with ng new angular-app
  • Run tests ng test
  • You will see Executed 3 of 3 SUCCESS
  • In app.component.spec.ts in some test, paste throw new Error();
  • CLI will print
  • Executed 3 of 3 SUCCESS (0.16 secs / 0.155 secs)
  • As you see karma prints that every test ends with success despite fact that one them should fail.
  • To rebuild your tests you have to close test CLI with Ctrl+C and launch it again. This finally make CLI to print proper message Chrome 56.0.2924 (Windows 10 0.0.0) AppComponent should render title in a h1 tag FAILED Failed: Error at webpack:///~/@angular/core/bundles/core-testing.umd.js:54:0 <- src/test.ts:32879:30 [ProxyZone] at webpack:///~/@angular/core/bundles/core-testing.umd.js:105:0 <- src/test.ts:32930:21 [ProxyZone] at AsyncTestZoneSpec.onInvoke (webpack:///~/zone.js/dist/async-test.js:49:0 <- src/test.ts:63577:39) [ProxyZone] at ProxyZoneSpec.onInvoke (webpack:///~/zone.js/dist/proxy.js:76:0 <- src/test.ts:64279:39) [ProxyZone] at Zone.run (webpack:///~/zone.js/dist/zone.js:126:0 <- src/polyfills.ts:1642:43) [ProxyZone => ProxyZone]
  • Chrome 56.0.2924 (Windows 10 0.0.0): Executed 3 of 3 (1 FAILED) (0.326 secs / 0.173 secs)

Info

  • Issue is very annoying and slows down development process.
  • The problem occurs after switching to 1.0.0-rc1. It works correctly in previous version (I use some beta, don't remember which exactly).
  • I think it's related to 5404
@maddev0
Copy link

maddev0 commented Mar 14, 2017

Experiencing the same issue since switching to 1.0.0-rc1. Sometimes tests are not automatically rebuilt. I put some changes into spec and save the file, ng test rebuilds tests but showing the results for unchanged spec. Restarting ng test solves the issue.

Sometimes automatic rebuild fails with the following message (actual project directory is replaced with PROJECT_DIR):

Chrome 56.0.2924 (Mac OS X 10.9.5) ERROR
  Uncaught Error: Module build failed: Error
      at WebpackCompilerHost.populateWebpackResolver (PROJECT_DIR/node_modules/@ngtools/webpack/src/compiler_host.js:135:51)
      at _donePromise.Promise.resolve.then.then.then.then (PROJECT_DIR/node_modules/@ngtools/webpack/src/plugin.js:327:32)
      at process._tickCallback (internal/process/next_tick.js:103:7)
  at src/test.ts:112583

@markheron91
Copy link

markheron91 commented Mar 14, 2017

Can confirm that I'm also getting this error running v1.0.0-rc.2 - saving files seems to kick off a new build but its as if nothing has been changed until the process is completely killed and restarted again.

EDIT: It looks like my problem was due to this #5351

My powershell was only spitting out the type errors on the first time round and then when it tried to compile when I saved the tests it was failing because of the type errors. Changing the types: [] to typeRoots: "" workaround described in that ticket solves the issue for me.

@coryrylan
Copy link
Contributor

coryrylan commented Mar 16, 2017

@markheron91 I have similar type errors like what you described. Unfortunately the typeRoot patch I mention in #5351 only seems to work part of the time for me. If a save a single spec file I get the type errors with Jasmine again.

@atom-morgan
Copy link

@coryrylan @markheron91 My tsconfig.json file has typeRoots as listed in the issue above and I'm still encountering this problem.

@filipesilva
Copy link
Contributor

This seems a dupe of #5332. It looks like sometimes past builds are served on ng test instead.

If someone has a simple repro of what you're experiencing here please post in #5332 to keep it in one place.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants