Skip to content

Jasmine constructs aren't available with beta 2 anymore #6817

Closed

Description

@andrashatvani

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'.

Activity

  1. alexeagle commented on Feb 1, 2016

    @alexeagle
    Contributor

    looks like a typechecking issue, do you have jasmine.d.ts in the inputs to the compiler?

  2. self-assigned this
    on Feb 1, 2016
  3. alexeagle commented on Feb 1, 2016

    @alexeagle
    Contributor

    Dupe of #6813

  4. andrashatvani commented on Feb 4, 2016

    @andrashatvani
    Author

    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.

  5. ericmdantas commented on Feb 4, 2016

    @ericmdantas
    Contributor

    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.

  6. filipesilva commented on Feb 4, 2016

    @filipesilva
    Contributor

    Ditto, it seems to be an unlisted breaking change. Now typings for tests have to be added separately.

  7. alexeagle commented on Feb 4, 2016

    @alexeagle
    Contributor

    @filipesilva you are right, this was an undocumented breaking change:
    a4b5cb8
    cc @vicb and @juliemr

    We have a test

    gulp.task('test.typings',

    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.

  8. ericmdantas commented on Feb 4, 2016

    @ericmdantas
    Contributor

    Thanks!

  9. filipesilva commented on Feb 4, 2016

    @filipesilva
    Contributor

    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).

  10. alexeagle commented on Feb 4, 2016

    @alexeagle
    Contributor

    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).

  11. filipesilva commented on Feb 4, 2016

    @filipesilva
    Contributor

    👍

  12. angular-automatic-lock-bot commented on Sep 7, 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.

  13. locked and limited conversation to collaborators on Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions