-
Notifications
You must be signed in to change notification settings - Fork 12k
ng test --environment works only once, but not on watch auto re-run #7305
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
Comments
+1 |
I'm sorry, but I cannot reproduce this problem. Can you upload a simple reproduction that shows this happening? I've seen a couple reports of similar things but was never able to reproduce it, so a clear simple repro would be very important. |
Thank you for looking after this. Until I changed the environment files. But if I change some other TS-file the watcher builds the app with environment.some.ts as expected. |
Thanks @filipesilva for the follow up. I created a work around where I always create the default dev environment file and that's been working well enough for now. I don't have time to create a new project right now for reproducing (our projects are private repos) but if you and others still can't let me know I can try to find some time to do so. |
@vonboth thank you so much!!! I can repro that!!! If I run
Now I know what's going wrong. Thank you!!! @lukemadera we do require the original file to exist so that's probably why it breaks in your scenario. |
I would just document this one... |
This bug made my project to send unneeded error reports (e.g. Sentry) export function provideErrorHandler() {
if (environment.production) {
return new RavenErrorHandler();
} else {
return new ErrorHandler();
}
} Error reporting must work only at production, but it keep sends report even on local dev env... Weird thing is this bug sends error report with url |
We changed file replacements in many PRs on the new 6.x workspace. I'm going to close this as fixed as we didn't have any new issues filed regarding environments and file replacements. If this happens in the latest version, please file a new issue with an updated reproduction. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug Report or Feature Request (mark with an
x
)Versions.
node --version
v6.10.1
npm --version
3.10.10
macOS (Sierra)
Repro steps.
npm run test
(which runsng test --environment=local
)This works fine (tests run successfully, using the specified environment).
This fails - it tries to re-run tests due to the change, but this time the environment is NOT used, instead the defaults
environment.ts
is used (which in our case leads to an error because it does not exist. Even if it did exist, it still is a bug as the proper environment is not being used).The log given by the failure.
Desired functionality.
The
environment.local.ts
specified by the--environment
flag is used ALL the time, not just on the first run. Which thus leads to a successful test watcher that will auto re-run tests on changes without breaking, as it does now.Mention any other details that might be useful.
The text was updated successfully, but these errors were encountered: