Skip to content

Instantly share code, notes, and snippets.

@erkobridee
Last active January 17, 2020 10:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erkobridee/b7ad5c2542471aff99d796819c58be41 to your computer and use it in GitHub Desktop.
Save erkobridee/b7ad5c2542471aff99d796819c58be41 to your computer and use it in GitHub Desktop.
[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