Skip to content

Commit

Permalink
Merge 99b9e0b into 0596d22
Browse files Browse the repository at this point in the history
  • Loading branch information
fb55 committed Nov 22, 2022
2 parents 0596d22 + 99b9e0b commit 18348f0
Show file tree
Hide file tree
Showing 14 changed files with 1,896 additions and 1,501 deletions.
8 changes: 4 additions & 4 deletions .eslintrc.json
Expand Up @@ -3,7 +3,7 @@
"extends": [
"eslint:recommended",
"plugin:jsdoc/recommended",
"plugin:node/recommended",
"plugin:n/recommended",
"prettier"
],
"env": { "node": true },
Expand Down Expand Up @@ -60,9 +60,9 @@
"jsdoc/valid-types": 2,
"jsdoc/tag-lines": 0,

"node/no-unsupported-features/es-syntax": 0,
"node/file-extension-in-import": ["error", "always"],
"node/no-missing-import": 0
"n/no-unsupported-features/es-syntax": 0,
"n/file-extension-in-import": ["error", "always"],
"n/no-missing-import": 0
},
"settings": {
"jsdoc": {
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/benchmark.yml
Expand Up @@ -8,7 +8,6 @@ on:

env:
FORCE_COLOR: 2
NODE: 16

permissions:
contents: read
Expand All @@ -25,7 +24,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v3.5.1
with:
node-version: '${{ env.NODE }}'
node-version: lts/*
cache: 'npm'

- name: Install npm dependencies
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Expand Up @@ -25,7 +25,6 @@ jobs:
fail-fast: false
matrix:
node:
- 12
- 14
- 16
- 18
Expand Down
2 changes: 1 addition & 1 deletion benchmark/benchmark.ts
@@ -1,4 +1,4 @@
import Suites from './suite'; // eslint-disable-line node/file-extension-in-import
import Suites from './suite'; // eslint-disable-line n/file-extension-in-import
import type { Cheerio } from '../src/cheerio.js';
import type { Element } from 'domhandler';

Expand Down
13 changes: 5 additions & 8 deletions benchmark/suite.ts
@@ -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

0 comments on commit 18348f0

Please sign in to comment.