Skip to content

refactor(@angular-devkit/schematics-cli): use latest version of jasmine for schematics#25694

Closed
santoshyadavdev wants to merge 1 commit intoangular:mainfrom
santoshyadavdev:master
Closed

refactor(@angular-devkit/schematics-cli): use latest version of jasmine for schematics#25694
santoshyadavdev wants to merge 1 commit intoangular:mainfrom
santoshyadavdev:master

Conversation

@santoshyadavdev
Copy link
Copy Markdown
Contributor

@santoshyadavdev santoshyadavdev commented Aug 18, 2023

Schematics project install jasmine, but its of very old version.

PR Checklist

Please check to confirm your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Currently jasmine version installed is very old

Issue Number: N/A

What is the new behavior?

Install the latest version of jasmine

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@JeanMeche
Copy link
Copy Markdown
Member

JeanMeche commented Aug 18, 2023

Hi Santosh, check out our commit message guidelines for the linting rule to pass 😉

@santoshyadavdev
Copy link
Copy Markdown
Contributor Author

Hi Santosh, check out our commit message guidelines for the linting rule to pass 😉

Sorry raised a PR after years, let me fix this

@santoshyadavdev
Copy link
Copy Markdown
Contributor Author

@JeanMeche should be ok now. But I was wondering if we should keep jasmine, my first thought was to remove it, but we can discuss and decide.

@santoshyadavdev
Copy link
Copy Markdown
Contributor Author

The error looks not related to this PR

@rainerhahnekamp
Copy link
Copy Markdown

In May, the Angular Robot tried to upgrade and got rejected because Jasmine 5 doesn't run on Node 16 anymore: angular/angular#50284

@santoshyadavdev I am all ears regarding dropping Jasmine. What are your reasons?

@santoshyadavdev
Copy link
Copy Markdown
Contributor Author

santoshyadavdev commented Aug 19, 2023 via email

@rainerhahnekamp
Copy link
Copy Markdown

rainerhahnekamp commented Aug 19, 2023

Understood.

I'd like to add that there are also reasons to use Jasmine instead of Jest:

  • Sound testing framework: The Angular team uses Jasmine as well. I guess the same is true for the rest of the Google Angular applications. In general, though, I also confirm that the majority outside of Google uses Jest.
  • Legacy Code: Especially Angular CLI-based applications that started out with Jasmine and already have a good testing code base might not have the need to switch to Jest.
  • Full browser environment: Certain types of tests need a full browser environment. Jest runs on JSDOM, which is not a browser and doesn't give you that kind of support.
  • Better support for asynchrony: There are some edge cases where Jest fails on asynchrony management. Jasmine doesn't have those obstacles.
  • Better Integration: Maybe the main argument for Jasmine. Jasmine is integrated into the build system of Angular. Because of that, Jest had many performance issues with ESM.

Either way, official support for Jest will finally come to Angular as well. There is already experimental support since version 16. So devs will be able to choose.

If you are interested in more, I've written a whole article about it: https://dev.to/this-is-angular/angular-testing-in-2023-past-present-and-future-j5m

@angular-automatic-lock-bot
Copy link
Copy Markdown

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 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants