Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
[gatsby testing] useful links #gastbyjs #js #testing

useful links about ts/js testing on a project with Gatsby.js

# 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment