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

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

Closed
JohannesRudolph opened this issue Jan 9, 2017 · 3 comments · Fixed by #5504
Closed

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

JohannesRudolph opened this issue Jan 9, 2017 · 3 comments · Fixed by #5504
Labels
needs: investigation Requires some digging to determine if action is needed P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent type: bug/fix

Comments

@JohannesRudolph
Copy link
Contributor

JohannesRudolph commented Jan 9, 2017

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

@JohannesRudolph
Copy link
Contributor Author

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.

@filipesilva filipesilva added needs: investigation Requires some digging to determine if action is needed P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent type: bug/fix labels Jan 24, 2017
filipesilva added a commit to filipesilva/angular-cli that referenced this issue Mar 19, 2017
Blocked by angular#5500 (fix is included in this PR so that CI will run).

Our unit test webpack config was erroneously sending in entry points to karma-webpack, who should receive no entry points.

This in turn was hiding errors related to typeRoots lookups.

It was also causing unit tests compilation to behave weirdly: unit test errors would not stop compilation, because other entries would still compile.

This might also have contributed to the overall slowness of unit tests in angular#5423.

Related to TypeStrong/ts-node#283

Fix angular#3911
Fix angular#5332
Fix angular#5351
filipesilva added a commit to filipesilva/angular-cli that referenced this issue Mar 20, 2017
Blocked by angular#5500 (fix is included in this PR so that CI will run).

Our unit test webpack config was erroneously sending in entry points to karma-webpack, who should receive no entry points.

This in turn was hiding errors related to typeRoots lookups.

It was also causing unit tests compilation to behave weirdly: unit test errors would not stop compilation, because other entries would still compile.

This might also have contributed to the overall slowness of unit tests in angular#5423.

Related to TypeStrong/ts-node#283

Fix angular#3911
Fix angular#5332
Fix angular#5351
hansl pushed a commit that referenced this issue Mar 20, 2017
Blocked by #5500 (fix is included in this PR so that CI will run).

Our unit test webpack config was erroneously sending in entry points to karma-webpack, who should receive no entry points.

This in turn was hiding errors related to typeRoots lookups.

It was also causing unit tests compilation to behave weirdly: unit test errors would not stop compilation, because other entries would still compile.

This might also have contributed to the overall slowness of unit tests in #5423.

Related to TypeStrong/ts-node#283

Fix #3911
Fix #5332
Fix #5351
@JohannesRudolph
Copy link
Contributor Author

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

@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
needs: investigation Requires some digging to determine if action is needed 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.

2 participants