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

22 lines
542 B
JavaScript

import process from 'node:process';
import fetch, {Request, Response, Headers} from 'node-fetch';
import {AbortController} from 'node-abort-controller';
import run from './run.js';
global.Request = Request;
global.Response = Response;
global.Headers = Headers;
global.fetch = fetch;
global.AbortController = AbortController;
async function main(file) {
const tests = await import('./' + file + '.js');
const result = await run(tests.default);
process.send(result);
}
main(process.argv[2]).catch((error) => {
console.error(error);
});