diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 3c88fdf..456143e 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -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: diff --git a/README.md b/README.md index f775612..8c85128 100644 --- a/README.md +++ b/README.md @@ -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) - diff --git a/package.json b/package.json index adccdb3..b5578dd 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,11 @@ }, "xo": { "prettier": true, - "globals": ["Request", "Response", "Headers", "fetch"] + "globals": [ + "Request", + "Response", + "Headers", + "fetch" + ] } } diff --git a/src/index.ts b/src/index.ts index 51817d5..c9e3a93 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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); } } diff --git a/src/platform-deno.ts b/src/platform-deno.ts index 2801409..3a765db 100644 --- a/src/platform-deno.ts +++ b/src/platform-deno.ts @@ -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 { 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 */ } }