1
0
Fork 0
fetch-compare/fixtures/index-node.js

18 lines
408 B
JavaScript
Raw Normal View History

2021-09-09 23:47:04 +08:00
import process from 'node:process';
import fetch, {Request, Response, Headers} from 'node-fetch';
import run from './run.js';
global.Request = Request;
global.Response = Response;
global.Headers = Headers;
global.fetch = fetch;
async function main(file) {
const tests = await import('./' + file + '.js');
const result = await run.default(tests.default);
process.send(result);
}
main(process.argv[2]);