Skip to content

ng test does not honor tsconfig.json compilation options #3911

Closed

Description

@JohannesRudolph

OS?

OS X El Cap.

Versions.

angular-cli: 1.0.0-beta.24
node: 6.9.1
os: darwin x64
@angular/common: 2.4.2
@angular/compiler: 2.4.2
@angular/core: 2.4.2
@angular/forms: 2.4.2
@angular/http: 2.4.2
@angular/platform-browser: 2.4.2
@angular/platform-browser-dynamic: 2.4.2
@angular/router: 3.4.2
@angular/compiler-cli: 2.4.2

Repro steps.

Use this repo: https://github.com/JohannesRudolph/angular-cli-rxjs-repro/tree/test-strict-null-check

It has "strictNullChecks": true in both tsconfig.json files and a .spec file with the following test that tsc in my editor (VSCode) correctly flags with null check errors:

describe('AppComponent', () => {
  beforeEach(() => {
  });

  it('violating null check should raise compilation error', () => {
    let string = '';
    string = null;

    const array = [];
    array.push(1);
  });
});

However, when I run ng test I get none of these errors.

The log given by the failure

I get the following log:

iDevBook01:observable-repro jr$ ng test
09 01 2017 09:25:52.623:WARN [watcher]: Pattern "/Users/jr/dev/tmp/observable-repro/src/assets/**" does not match any file.
09 01 2017 09:26:02.000:WARN [karma]: No captured browser, open http://localhost:9876/   
09 01 2017 09:26:02.008:WARN [karma]: Port 9876 in use
09 01 2017 09:26:02.008:INFO [karma]: Karma v1.2.0 server started at http://localhost:9877/
09 01 2017 09:26:02.009:INFO [launcher]: Launching browser Chrome with unlimited concurrency
09 01 2017 09:26:02.015:INFO [launcher]: Starting browser Chrome
09 01 2017 09:26:03.113:INFO [Chrome 55.0.2883 (Mac OS X 10.11.6)]: Connected on socket /#Ey3SzNdnfw0H2k6BAAAA with id 38623434
Chrome 55.0.2883 (Mac OS X 10.11.6): Executed 1 of 1 SUCCESS (0.009 secs / 0.002 secs)

Mention any other details that might be useful.

This issue may be somewhat related to (but its for sure not the same one) as #2778

Activity

  1. JohannesRudolph commented on Jan 13, 2017

    @JohannesRudolph
    ContributorAuthor

    Unfortunately the same error persists in beta 25. See https://github.com/JohannesRudolph/angular-cli-rxjs-repro/tree/test-strict-null-check for a repro.

    I had hoped it was somehow fixed by #3831 but that's apparently not the case.

  2. added
    needs: investigationRequires some digging to determine if action is needed
    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
    on Jan 24, 2017
  3. added 2 commits that reference this issue on Mar 19, 2017
    a560646
    adabd88
  4. added a commit that references this issue on Mar 20, 2017
    303b2c0
  5. JohannesRudolph commented on Mar 23, 2017

    @JohannesRudolph
    ContributorAuthor

    A big kudos to the team for fixing a bunch of remaining ng test related bugs in 1.0.0-rc.4. Great work!!!

  6. angular-automatic-lock-bot commented on Sep 6, 2019

    @angular-automatic-lock-bot

    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.

  7. locked and limited conversation to collaborators on Sep 6, 2019
  8. added a commit that references this issue on May 29, 2026
    586606e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentneeds: investigationRequires some digging to determine if action is neededtype: bug/fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions