Skip to content

Instantly share code, notes, and snippets.

@michelalbers
Created September 9, 2018 18:59
Show Gist options
  • Save michelalbers/2fd1e730ff410eda2e7b15aaab1ba9dc to your computer and use it in GitHub Desktop.
Save michelalbers/2fd1e730ff410eda2e7b15aaab1ba9dc to your computer and use it in GitHub Desktop.
Jest Setup file for testing a GraphQL Next.js App with TypeScript and Apollo
const enzyme = require('enzyme');
const Adapter = require('enzyme-adapter-react-16');
const config = require('./next.config');
const nextConfig = require('next/config');
enzyme.configure({ adapter: new Adapter() });
nextConfig.setConfig({
publicRuntimeConfig: {
IMAGE_SERVER_URL: 'http://images.foo.bar',
IMAGE_PROCESSOR_URL: 'https://processor.foo.bar',
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment