Get tests passing again

This commit is contained in:
Michael Jackson
2019-07-09 17:21:25 -07:00
parent 2e3c9ff526
commit f3ecddea47
42 changed files with 309 additions and 305 deletions

View File

@ -1,16 +1,18 @@
import fetch from 'isomorphic-fetch';
import invariant from 'invariant';
const cloudflareURL = 'https://api.cloudflare.com/client/v4';
const cloudflareEmail = process.env.CLOUDFLARE_EMAIL;
const cloudflareKey = process.env.CLOUDFLARE_KEY;
invariant(
cloudflareEmail,
'Missing the $CLOUDFLARE_EMAIL environment variable'
);
if (process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test') {
if (!cloudflareEmail) {
throw new Error('Missing the $CLOUDFLARE_EMAIL environment variable');
}
invariant(cloudflareKey, 'Missing the $CLOUDFLARE_KEY environment variable');
if (!cloudflareKey) {
throw new Error('Missing the $CLOUDFLARE_KEY environment variable');
}
}
function get(path, headers) {
return fetch(`${cloudflareURL}${path}`, {