@axe-core/puppeteer 4.8.2-b393bcd.0 → 4.8.2-b5aee34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,48 @@
1
+ import * as Axe from 'axe-core';
2
+ import { SerialFrameSelector, RunOptions, Spec, AxeResults } from 'axe-core';
3
+ import { Page, Frame, Browser } from 'puppeteer';
4
+
5
+ type AnalyzeCB = (err: Error | null, result?: Axe.AxeResults) => void;
6
+ interface IPageOptions {
7
+ opts?: any;
8
+ source?: string;
9
+ }
10
+
11
+ declare class AxePuppeteer {
12
+ private frame;
13
+ private axeSource?;
14
+ private includes;
15
+ private excludes;
16
+ private axeOptions;
17
+ private config;
18
+ private disabledFrameSelectors;
19
+ private page;
20
+ private legacyMode;
21
+ private errorUrl;
22
+ constructor(pageFrame: Page | Frame, source?: string);
23
+ include(selector: SerialFrameSelector): this;
24
+ exclude(selector: SerialFrameSelector): this;
25
+ options(options: RunOptions): this;
26
+ withRules(rules: string | string[]): this;
27
+ withTags(tags: string | string[]): this;
28
+ disableRules(rules: string | string[]): this;
29
+ configure(config: Spec): this;
30
+ disableFrame(selector: string): this;
31
+ setLegacyMode(legacyMode?: boolean): this;
32
+ analyze(): Promise<AxeResults>;
33
+ analyze<T extends AnalyzeCB>(callback?: T): Promise<AxeResults | null>;
34
+ private analyzePromise;
35
+ private runPartialRecursive;
36
+ private finishRun;
37
+ private runLegacy;
38
+ }
39
+
40
+ declare function loadPage(browser: Browser, url: string, pageOpts?: IPageOptions): Promise<OwningAxePuppeteer>;
41
+ declare class OwningAxePuppeteer extends AxePuppeteer {
42
+ private newPage;
43
+ constructor(page: Page, source?: string);
44
+ analyze(): Promise<Axe.AxeResults>;
45
+ analyze<T extends AnalyzeCB>(callback?: T): Promise<Axe.AxeResults | null>;
46
+ }
47
+
48
+ export { AnalyzeCB, AxePuppeteer, IPageOptions, AxePuppeteer as default, loadPage };
package/dist/index.js CHANGED
@@ -535,3 +535,16 @@ var src_default = AxePuppeteer;
535
535
  AxePuppeteer,
536
536
  loadPage
537
537
  });
538
+
539
+ if (module.exports.default) {
540
+ var ___default_export = module.exports.default;
541
+ var ___export_entries = Object.entries(module.exports);
542
+ module.exports = ___default_export;
543
+ ___export_entries.forEach(([key, value]) => {
544
+ if (module.exports[key]) {
545
+ throw new Error(`Export "${key}" already exists on default export`);
546
+ }
547
+
548
+ module.exports[key] = value;
549
+ });
550
+ }
package/dist/index.mjs CHANGED
@@ -3,7 +3,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
3
3
  }) : x)(function(x) {
4
4
  if (typeof require !== "undefined")
5
5
  return require.apply(this, arguments);
6
- throw new Error('Dynamic require of "' + x + '" is not supported');
6
+ throw Error('Dynamic require of "' + x + '" is not supported');
7
7
  });
8
8
 
9
9
  // src/axePuppeteer.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axe-core/puppeteer",
3
- "version": "4.8.2-b393bcd.0+b393bcd",
3
+ "version": "4.8.2-b5aee34.0+b5aee34",
4
4
  "description": "Provides a chainable axe API for Puppeteer and automatically injects into all frames",
5
5
  "repository": {
6
6
  "type": "git",
@@ -25,7 +25,10 @@
25
25
  "scripts": {
26
26
  "build": "tsup src/index.ts --dts --format esm,cjs",
27
27
  "test": "mocha --timeout 60000 -r ts-node/register 'test/**.spec.ts'",
28
+ "test:export": "npm run test:esm && npm run test:commonjs && npm run test:ts",
28
29
  "test:esm": "node test/esmTest.mjs",
30
+ "test:commonjs": "node test/commonjsTest.js",
31
+ "test:ts": "tsc test/tsTest.ts --noEmit --skipLibCheck --esModuleInterop",
29
32
  "coverage": "nyc npm run test",
30
33
  "prepublishOnly": "npm run build"
31
34
  },
@@ -37,7 +40,7 @@
37
40
  "@types/mocha": "^10.0.0",
38
41
  "@types/node": "^20.8.10",
39
42
  "@types/sinon": "^10.0.13",
40
- "@types/test-listen": "^1.1.0",
43
+ "async-listen": "^3.0.1",
41
44
  "axe-test-fixtures": "github:dequelabs/axe-test-fixtures#v1",
42
45
  "chai": "^4.3.6",
43
46
  "cross-dirname": "^0.1.0",
@@ -47,9 +50,8 @@
47
50
  "puppeteer": "19.7.3",
48
51
  "sinon": "^14.0.1",
49
52
  "source-map-support": "^0.5.21",
50
- "test-listen": "^1.1.0",
51
53
  "ts-node": "^10.9.1",
52
- "tsup": "^6.7.0",
54
+ "tsup": "^7.2.0",
53
55
  "typescript": "^4.8.4"
54
56
  },
55
57
  "dependencies": {
@@ -88,5 +90,5 @@
88
90
  "functions": 85,
89
91
  "lines": 85
90
92
  },
91
- "gitHead": "b393bcd74814835c16712d95e3cc38bd4cc67b1d"
93
+ "gitHead": "b5aee3424fe4d0fbc0b2065e9c0bc56ce4032755"
92
94
  }