Great article you put up here, i am quite new to TDD and your article helped clarify somethings.
However in the farouriteMovieService test section there is the "jest" variable you used, and i was wondering how you got it. Is it from a library you added to the project?
Glad to hear that it’s helpful!
So, jest is an alternative to karma. It’s a test suite.
The variable comes from the “jest” package.
Let me knowing you need more info.
Thanks for your reply, I figured Jest is a test suite when i did some research, i had installed and configured it following their guide, however the test fails when i run it. I get this error message "error TS2304: Cannot find name 'jest'."
I had installed the jest package, @types/jest, jest-preset-angular and added jest in types [] in all tsconfig.*.json files and i still get the same error.
Keep in mind they are not needed in all the others tsconfig.*.json files.
Also make sure you also install jest, not just jest-preset-angular.
So, you need jest, @types/jest and jest-preset-angular; then add the "jest" types to tsconfig.spec.json and that should be it.
Sorry for the late answer. Holiday more :)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi Catalin,
Great article you put up here, i am quite new to TDD and your article helped clarify somethings.
However in the farouriteMovieService test section there is the "jest" variable you used, and i was wondering how you got it. Is it from a library you added to the project?
Hello didi-rare!
Glad to hear that it’s helpful!
So, jest is an alternative to karma. It’s a test suite.
The variable comes from the “jest” package.
Let me knowing you need more info.
Hi,
Thanks for your reply, I figured Jest is a test suite when i did some research, i had installed and configured it following their guide, however the test fails when i run it. I get this error message "error TS2304: Cannot find name 'jest'."
I had installed the jest package, @types/jest, jest-preset-angular and added jest in types [] in all tsconfig.*.json files and i still get the same error.
Do you have any pointers?
I use Webstorm IDE.
So, all I have it this in my tsconfig.spec.json:
"types": ["jest", "node"]
Keep in mind they are not needed in all the others tsconfig.*.json files.
Also make sure you also install jest, not just jest-preset-angular.
So, you need jest, @types/jest and jest-preset-angular; then add the "jest" types to tsconfig.spec.json and that should be it.
Sorry for the late answer. Holiday more :)