Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add functions to load buffers, streams & URLs in NodeJS #2857

Merged
merged 18 commits into from
Nov 28, 2022
Merged
13 changes: 5 additions & 8 deletions benchmark/suite.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import fs from 'fs';
import path from 'path';
import fs from 'node:fs';
import path from 'node:path';
import { Script } from 'node:vm';

import { Suite, Event } from 'benchmark';
// @ts-expect-error `jsdom` types currently collide with `parse5` types.
import { JSDOM } from 'jsdom';
import { Script } from 'vm';
import cheerio from '../lib/index.js';

const documentDir = path.join(__dirname, 'documents');
Expand Down Expand Up @@ -74,11 +73,9 @@ export default class Suites {

jQueryScript.runInContext(dom.getInternalVMContext());

const setupData: T = options.setup(dom.window.$);
const setupData: T = options.setup(dom.window['$']);

suite.add('jsdom', () => {
testFn(dom.window.$, setupData);
});
suite.add('jsdom', () => testFn(dom.window['$'], setupData));
suite.run();
}

Expand Down
Loading