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

why the types node,jasmine in tsconfig.spec.json? #5106

Closed
stefanaerts opened this issue Feb 28, 2017 · 6 comments
Closed

why the types node,jasmine in tsconfig.spec.json? #5106

stefanaerts opened this issue Feb 28, 2017 · 6 comments

Comments

@stefanaerts
Copy link

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

mac osx

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:
image

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

The log given by the failure.

Normally this include a stack trace and some more information.

when i remove the types jasmin,node from the tsconfig.spec.json file,
npm run test and npm run e2e still work fine for my empty project
I wonder why?

Mention any other details that might be useful.


Thanks! We'll be in touch soon.

@Brocco
Copy link
Contributor

Brocco commented Mar 1, 2017

When you say "removed from my project" what did that entail?

@stefanaerts
Copy link
Author

Sry i was not clear, i removed it from types in tsconfig.spec.json.
And run the test and e2e after that,both worked fine

@filipesilva
Copy link
Contributor

tsconfig.spec.json is used for unit tests only with ng test, and not having them there should give you a couple of errors like what happens when you remove them (and leave an empty array) from tsconfig.e2e.json:

e2e\app.e2e-spec.ts (2,23): Cannot find name 'exports'. (2304)
e2e\app.e2e-spec.ts (3,18): Cannot find name 'require'. (2304)
e2e\app.e2e-spec.ts (4,1): Cannot find name 'describe'. (2304)
e2e\app.e2e-spec.ts (6,5): Cannot find name 'beforeEach'. (2304)
e2e\app.e2e-spec.ts (9,5): Cannot find name 'it'. (2304)
e2e\app.e2e-spec.ts (11,9): Cannot find name 'expect'. (2304)

I tested it right now and it's as you say ng test does not show errors after removing them. This makes me think there's something broken somewhere. Thanks for bringing this up!

@coryrylan
Copy link
Contributor

I think this might be related #5322
To get require to be recognized I added the following in my tsconfig.app.json and now with RC its like it is ignoring the types array.

"types": [
      "node"
    ]

@filipesilva
Copy link
Contributor

filipesilva commented Mar 19, 2017

Dupe of #5351

@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.
Projects
None yet
Development

No branches or pull requests

4 participants