diff --git a/test/benchmark/index.js b/test/benchmark/index.js index a5c4c47..c96f96b 100644 --- a/test/benchmark/index.js +++ b/test/benchmark/index.js @@ -1,6 +1,7 @@ -const Benchmark = require('benchmark'); -const polyfill = require('../../dist/ponyfill.js'); -const stardazed = require('@stardazed/streams'); +import Benchmark from 'benchmark'; +import * as polyfill from 'web-streams-polyfill'; +import * as stardazed from '@stardazed/streams'; + const suite = new Benchmark.Suite(); const implementations = [ @@ -24,7 +25,7 @@ function testCount(impl, count, deferred) { } function readLoop(count, reader) { - return reader.read().then(result => { + return reader.read().then((result) => { if (result.done) { return undefined; } @@ -43,13 +44,11 @@ for (const [name, impl] of implementations) { } suite - .on('cycle', event => { - // eslint-disable-next-line no-console + .on('cycle', (event) => { const bench = event.target; console.log(`${String(bench)} (period: ${(bench.times.period * 1000).toFixed(2)}ms)`); }) .on('complete', () => { - // eslint-disable-next-line no-console console.log('Done'); }) .run({ async: true }); diff --git a/test/benchmark/package-lock.json b/test/benchmark/package-lock.json index 09577ee..e33dc2f 100644 --- a/test/benchmark/package-lock.json +++ b/test/benchmark/package-lock.json @@ -9,7 +9,39 @@ "version": "0.0.0", "devDependencies": { "@stardazed/streams": "^3.1.0", - "benchmark": "^2.1.4" + "benchmark": "^2.1.4", + "web-streams-polyfill": "file:../.." + } + }, + "../..": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "devDependencies": { + "@eslint/js": "^9.17.0", + "@microsoft/api-extractor": "^7.48.1", + "@rollup/plugin-inject": "^5.0.5", + "@rollup/plugin-replace": "^6.0.2", + "@rollup/plugin-strip": "^3.0.4", + "@rollup/plugin-terser": "^0.4.4", + "@rollup/plugin-typescript": "^12.1.2", + "@stylistic/eslint-plugin": "^2.12.1", + "@types/node": "^20.17.11", + "eslint": "^9.17.0", + "globals": "^15.14.0", + "jasmine": "^5.5.0", + "micromatch": "^4.0.8", + "minimist": "^1.2.8", + "playwright": "^1.49.1", + "rollup": "^4.29.2", + "st": "^3.0.1", + "tslib": "^2.8.1", + "typescript": "^5.7.2", + "typescript-eslint": "^8.19.0", + "wpt-runner": "^6.0.0" + }, + "engines": { + "node": ">= 8" } }, "node_modules/@stardazed/streams": { @@ -40,6 +72,10 @@ "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.5.tgz", "integrity": "sha512-TuvHS8AOIZNAlE77WUDiR4rySV/VMptyMfcfeoMgs4P8apaZM3JrnbzBiixKUv+XR6i+BXrQh8WAnjaSPFO65Q==", "dev": true + }, + "node_modules/web-streams-polyfill": { + "resolved": "../..", + "link": true } } } diff --git a/test/benchmark/package.json b/test/benchmark/package.json index 13aa130..84eae6b 100644 --- a/test/benchmark/package.json +++ b/test/benchmark/package.json @@ -2,12 +2,13 @@ "name": "web-streams-polyfill-benchmark", "version": "0.0.0", "private": true, - "main": "index.js", + "type": "module", "scripts": { "benchmark": "node --prof index.js" }, "devDependencies": { "@stardazed/streams": "^3.1.0", - "benchmark": "^2.1.4" + "benchmark": "^2.1.4", + "web-streams-polyfill": "file:../.." } }