You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Jasmine constructs aren't available with beta 2 anymore #6817
After the upgrade to beta 2 I suddenly see the following errors:
Error:(4, 5) TS2304: Cannot find name 'it'.
Error:(13, 9) TS2304: Cannot find name 'expect'.
Error:(39, 36) TS2339: Property 'toBeNull' does not exist on type 'NgMatchers'.
No, I don't explicitly reference jasmine.d.ts and it was no problem with beta 1. Starting with beta 2 my IDE complains that these constructs can't be found. The issue is still present with beta 3.
I am working on this stuff right now, I will fold a fix into #6267
But note that the fix will be: Angular 2 no longer pollutes your compilation with our typings files, because you might use a different version of the library, and therefore should use the corresponding typing file. So you will indeed continue installing the jasmine typing yourself. We need to add documentation for that in beta.4.
It makes sense, and is a sensible change. The other option would be to magically guess whatever typings angular2 included, and avoiding those (otherwise tsc would error out due to duplicate typings).
Even with that magic, you have the versioning problem that you might want a
newer (or older!) jasmine.d.ts than angular2 ships with.
The typings version should match your devDependency version, not whatever
was latest when the angular package you're using shipped.
To be clear, I'm fixing this issue by documenting the breaking change, not
by re-instating the jasmine typing.
On Thu, Feb 4, 2016 at 12:36 PM Filipe Silva [email protected]
wrote:
It makes sense, and is a sensible change. The other option would be to
magically guess whatever typings angular2 included, and avoiding those
(otherwise tsc would error out due to duplicate typings).
—
Reply to this email directly or view it on GitHub #6817 (comment).
Activity
alexeagle commentedon Feb 1, 2016
looks like a typechecking issue, do you have
jasmine.d.tsin the inputs to the compiler?alexeagle commentedon Feb 1, 2016
Dupe of #6813
andrashatvani commentedon Feb 4, 2016
No, I don't explicitly reference jasmine.d.ts and it was no problem with beta 1. Starting with beta 2 my IDE complains that these constructs can't be found. The issue is still present with beta 3.
ericmdantas commentedon Feb 4, 2016
Same here.
I mean, I got it to work by manually adding the typings for jasmine, but I'd like to know if that's a bug or if that's the way it is now.
filipesilva commentedon Feb 4, 2016
Ditto, it seems to be an unlisted breaking change. Now typings for tests have to be added separately.
alexeagle commentedon Feb 4, 2016
@filipesilva you are right, this was an undocumented breaking change:
a4b5cb8
cc @vicb and @juliemr
We have a test
angular/gulpfile.js
Line 869 in a4b5cb8
which sets up a directory to look like an angular2 app, and type-checks it.
But you can see here
https://github.com/angular/angular/tree/a4b5cb837682ce61f8c07eabd7ae8c4dc3ba80a7/typing_spec
that we are missing a testing example. If we had one, we would have noticed the breaking change.
I am working on this stuff right now, I will fold a fix into #6267
But note that the fix will be: Angular 2 no longer pollutes your compilation with our typings files, because you might use a different version of the library, and therefore should use the corresponding typing file. So you will indeed continue installing the jasmine typing yourself. We need to add documentation for that in beta.4.
Sorry for breaking you.
ericmdantas commentedon Feb 4, 2016
Thanks!
filipesilva commentedon Feb 4, 2016
It makes sense, and is a sensible change. The other option would be to magically guess whatever typings angular2 included, and avoiding those (otherwise
tscwould error out due to duplicate typings).alexeagle commentedon Feb 4, 2016
Even with that magic, you have the versioning problem that you might want a
newer (or older!) jasmine.d.ts than angular2 ships with.
The typings version should match your devDependency version, not whatever
was latest when the angular package you're using shipped.
To be clear, I'm fixing this issue by documenting the breaking change, not
by re-instating the jasmine typing.
On Thu, Feb 4, 2016 at 12:36 PM Filipe Silva [email protected]
wrote:
filipesilva commentedon Feb 4, 2016
👍
angular-automatic-lock-bot commentedon Sep 7, 2019
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.