Skip to content

Commit

Permalink
feat: Add functions to load buffers, streams & URLs in NodeJS (#2857)
Browse files Browse the repository at this point in the history
  • Loading branch information
fb55 authored Nov 28, 2022
1 parent f45682a commit 82a121a
Show file tree
Hide file tree
Showing 6 changed files with 779 additions and 24 deletions.
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

0 comments on commit 82a121a

Please sign in to comment.