Open in app
Andreas Ehrencrona
3 Followers
About

Sign in

3 Followers
About
Open in app
Unit Testing for Gatsby using Jest, Typescript and React Testing Library
2
1

Michael Rhema

Andreas Ehrencrona

Andreas Ehrencrona

Jul 3, 2020·1 min read

The tricky part when unit testing Gatsby code is how to handle components that use GraphQL queries. You might want to take a look at my plugin gatsby-plugin-testing that makes that possible. It stores the query data when you run gatsby build so it can feed the actual data back to the components when running the tests.

Written by

Andreas Ehrencrona

More from Andreas Ehrencrona

More From Medium

A Svelte application with authentication and storage

Andreas Ehrencrona in JavaScript In Plain English

The Financial Paradox of Owning a Home

Ben Le Fort in Making of a Millionaire

35 unforgettable images that capture Trump’s wild and bitter presidency

Business Insider in Business Insider

Donald Trump Revealed the Truth About White America

umair haque in Eudaimonia and Co

Newlywed Bride Pushes Husband Off Cliff 8 Days After Their Wedding

Fatim Hemraj in Chameleon

8 Things I Wish More People Knew in Their 20s

Sean Kernan in The Ascent

2021 Really Starts Now: Six Big Predictions for the Post-Trump Era

Steve LeVine in GEN

Five Signs You’re With the One

The Good Men Project in Hello, Love

About

Help

Legal

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store