nrwl/nx

question: jest and jasmine

Closed this issue ยท 3 comments

I am new to jest and I use a custom jest integration for my tests at the moment, but will switch to the new nrwl jest integration in the next few days. ๐Ÿ‘ for that!

My tests are compatible with jest, but I am wondering what would happen if I use jasmine specific code - as far as I understood the situation mostly all jasmine code is compatible with jest (you could use jest-codemods), but sooner or later you could end up in a situation where you use jasmine-only code.

Removing jasmine in general is not an option because the e2e tests are still using jasmine, when I got that right. Removing karma-jasmine and karma-jasmine-html-reporter should be possible? Are the non-e2e tests still using jasmine typings (ts setup that the ide is using), and unit tests are using jest typings? Any opinion on that topic would be very useful to me.

The e2e tests are still using jasmine typings so keep those. karma related dependencies should be safe to remove if you are using jest throughout your whole workspace. For now, we will keep these dependencies as part of the generated workspace so users can use both karma or slowly migrate their code to use jest.

karma dependencies:

  • karma
  • karma-chrome-launcher
  • karma-coverage-istanbul-reporter
  • karma-jasmine karma-jasmine-html-reporter

Remove with yarn:

yarn remove karma karma-chrome-launcher karma-coverage-istanbul-reporter karma-jasmine karma-jasmine-html-reporter

ok, I see "types": ["jest", "node"] in tsconfig.spec.json and "types": ["jasmine", "jasminewd2", "node"] in tsconfig.e2e.json - and thx for the verification that the karma dependencies can be removed if the whole workspace is migrated to use jest.

Thank you!

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.