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

21 lines
442 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');
2021-09-10 00:37:10 +08:00
const result = await run(tests.default);
2021-09-09 23:47:04 +08:00
process.send(result);
}
2021-09-10 00:37:10 +08:00
main(process.argv[2])
.catch((error) => {
log.error(error);
});