Skip to content

"ng test" does not bail on type definition errors #3424

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

Closed
huyph opened this issue Dec 6, 2016 · 3 comments · Fixed by #5504
Closed

"ng test" does not bail on type definition errors #3424

huyph opened this issue Dec 6, 2016 · 3 comments · Fixed by #5504
Labels
effort1: easy (hours) P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent type: bug/fix

Comments

@huyph
Copy link

huyph commented Dec 6, 2016

OS

Mac OSX - EL Capitan

Versions.

angular-cli: 1.0.0-beta.19-3
node: 6.4.0
os: darwin x64

Repro steps.

  • Have a default angular-cli setup in place (by running "ng new <project_name>")
  • Then there should be AppComponent and its spec file created by default.
  • Add a new method in app.component.ts:
public static returnAorB(character: 'A' | 'B') {
  return character;
}

And add following line anywhere in app.component.spec.ts:

expect(AppComponent.returnAorB('C')).toEqual('C');
  • Run "ng test --watch=false"

It will generate an error complaining Argument of type '"C"' is not assignable to parameter of type '"A" | "B"'. But the command did not exit.

The log given by the failure.

....
ERROR in [default] <path>/src/app/app.component.spec.ts:16:35 
Argument of type '"C"' is not assignable to parameter of type '"A" | "B"'.
.....
(Completes and Exits with successful code)
@hansl
Copy link
Contributor

hansl commented Dec 6, 2016

Right, we don't check for build errors on test. That's a bug, thanks! Will fix.

@hansl hansl added effort1: easy (hours) P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent type: bug/fix labels Dec 6, 2016
@JohannesRudolph
Copy link
Contributor

I think this is a duplicate of #2778 , which is incorrectly flagged as "need: repro steps" right now as @huyph here and @fabian-dev in the linked issue have produced a repro sample.

filipesilva added a commit to filipesilva/angular-cli that referenced this issue Mar 19, 2017
filipesilva added a commit to filipesilva/angular-cli that referenced this issue Mar 19, 2017
filipesilva added a commit to filipesilva/angular-cli that referenced this issue Mar 19, 2017
filipesilva added a commit to filipesilva/angular-cli that referenced this issue Mar 20, 2017
filipesilva added a commit to filipesilva/angular-cli that referenced this issue Mar 20, 2017
hansl pushed a commit that referenced this issue Mar 20, 2017
@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
effort1: easy (hours) P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants