useful links about ts/js testing on a project with Gatsby.js
-
Jest - is a delightful JavaScript Testing Framework with a focus on simplicity.
-
Configuring Jest to show code coverage for all of your files
-
Best kept Jest secret: Testing only changed files with coverage reports | @stipsan - Medium
-
Mocking TypeScript classes with Jest | David Guijarro - Medium
-
Debugging with TypeScript, Jest, ts-jest and Visual Studio Code
-
[GitHub] kulshekhar/ts-jest - TypeScript preprocessor with sourcemap support for Jest
-
[GitHub] zeit / next.js - Testing with typescript + jest + ts-jest #8663 - tip to how to solve the jsx parsing problem
-
[GitHub] jest-community / jest-junit - A Jest reporter that creates compatible junit xml files
-
Testing in React with Jest and Enzyme: An Introduction | @rossbulat - Medium
-
Test Driven Development in React with Jest and Enzyme | @rossbulat - Medium
# jest dependencies
npm install --save-dev jest babel-jest react-test-renderer babel-preset-gatsby identity-obj-proxy
#jest + gastsby (react) dependencies
npm install --save-dev jest babel-jest babel-preset-gatsby @testing-library/react @testing-library/jest-dom identity-obj-proxy
# typescript support
npm install --save-dev ts-jest @types/jest
# A Jest reporter that creates compatible junit xml files
npm install --save-dev jest-junit
Typescript reduces the number of unit tests you need to write
One of the first reasons I see is the insane gain of time when it comes to testing your code. If you wrote any tests at all before, you can count on a 10–20% decrease on how many you have to write. If you didn’t, then you gain those extra 20% at no cost!