1
0
Fork 0

fix: Placeholder for platform-deno

pull/1/head
Ambrose Chua 2021-09-10 00:07:54 +08:00
parent 85e6377929
commit 4c2a24377f
5 changed files with 16 additions and 6 deletions

View File

@ -68,6 +68,4 @@ jobs:
- run: npm run lint --if-present
# TODO: Generate and publish a HTML artifact
- run: npm start
# vim: set et ts=2 sw=2:

View File

@ -1,4 +1,3 @@
# Comparing `fetch()` implementations
A small project comparing `fetch()` implementations across various platforms
@ -15,5 +14,4 @@ Browser testing is done using [`webdriver`](https://github.com/webdriverio/webdr
- `node-fetch`
- Deno (TODO)
<!-- vim: set conceallevel=2 et ts=2 sw=2: -->

View File

@ -42,6 +42,11 @@
},
"xo": {
"prettier": true,
"globals": ["Request", "Response", "Headers", "fetch"]
"globals": [
"Request",
"Response",
"Headers",
"fetch"
]
}
}

View File

@ -70,7 +70,7 @@ async function run() {
try {
results[name] = await platforms[name].run(ctx, 'all');
log.debug(name, results[name]);
} catch (error: Error) {
} catch (error: unknown) {
log.error(name, error);
}
}

View File

@ -1,3 +1,4 @@
import cp from 'node:child_process';
// @ts-expect-error: Missing types
import {binary} from 'deno-prebuilt';
@ -6,5 +7,13 @@ import {Platform, Result} from './types.js';
export default class PlatformDeno implements Platform {
async run(): Promise<Result> {
throw new Error('not implemented');
/* eslint-disable no-unreachable */
const child = cp.spawn(binary, []);
await new Promise((resolve, reject) => {
child.once('error', reject);
child.once('spawn', resolve);
});
child.kill();
/* eslint-enable no-unreachable */
}
}