Skip to content

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

Closed
@huyph

Description

@huyph

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgenteffort1: easy (hours)type: bug/fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions