Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save michelepatrassi/939f7179a39d772517cfb106a13ed14d to your computer and use it in GitHub Desktop.
Save michelepatrassi/939f7179a39d772517cfb106a13ed14d to your computer and use it in GitHub Desktop.
Setup: Angular unit testing
Jest configuration:
- use jest with angular with jest preset angular (follow readme): https://www.npmjs.com/package/jest-preset-angular
- remove Jasmine types, because it duplicates the declaration from @types/jest: npm uninstall @types/jasmine
Visual studio extensions:
- jest
- snapshot-tools
Other useful libraries (from youtube video):
- jasmine marbles to test observables: https://www.npmjs.com/package/jasmine-marbles
- angular testing library: https://www.npmjs.com/package/angular-testing-library
References:
- https://www.xfive.co/blog/testing-angular-faster-jest/
- https://www.youtube.com/watch?time_continue=397&v=MTZprd9tI6c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment