inject fetch into KV emu

This commit is contained in:
41666 2020-12-14 14:10:24 -05:00
parent 22cbde52dd
commit 12d8e99513
2 changed files with 3 additions and 0 deletions

View file

@ -9,6 +9,7 @@ const { Crypto } = require('@peculiar/webcrypto');
const roleypolyConfig = require('../backend-worker/roleypoly.config');
const { KVShim } = require('./kv');
const crypto = new Crypto();
const fetch = require('node-fetch');
const getKVs = (namespaces = []) =>
namespaces.reduce((acc, ns) => ({ ...acc, [ns]: new KVShim(ns) }), {});
@ -43,6 +44,7 @@ const context = () =>
setInterval: setInterval,
clearInterval: clearInterval,
clearTimeout: clearTimeout,
fetch: fetch,
...workerShims,
},
{