testaro 47.0.1 → 47.1.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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/tests/alfa.js +6 -3
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "testaro",
3
- "version": "47.0.1",
4
- "description": "Run 1000 web accessibility tests from 10 tools and get a standardized report",
3
+ "version": "47.1.0",
4
+ "description": "Run 1000 web accessibility tests from 11 tools and get a standardized report",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "tests": "node validation/executors/tests",
package/tests/alfa.js CHANGED
@@ -27,9 +27,6 @@
27
27
 
28
28
  // IMPORTS
29
29
 
30
- const {Audit} = require('@siteimprove/alfa-act');
31
- const {Playwright} = require('@siteimprove/alfa-playwright');
32
- let alfaRules = require('@siteimprove/alfa-rules').default;
33
30
  const {doBy} = require('../procs/job');
34
31
 
35
32
  // FUNCTIONS
@@ -38,6 +35,8 @@ const {doBy} = require('../procs/job');
38
35
  exports.reporter = async (page, report, actIndex, timeLimit) => {
39
36
  const act = report.acts[actIndex];
40
37
  const {rules} = act;
38
+ const alfaRulesModule = await import('@siteimprove/alfa-rules');
39
+ const alfaRules = alfaRulesModule.default;
41
40
  // If only some rules are to be employed:
42
41
  if (rules && rules.length) {
43
42
  // Remove the other rules.
@@ -89,7 +88,11 @@ exports.reporter = async (page, report, actIndex, timeLimit) => {
89
88
  }
90
89
  // Test the page content with the specified rules.
91
90
  const doc = await page.evaluateHandle('document');
91
+ const alfaPlaywrightModule = await import('@siteimprove/alfa-playwright');
92
+ const {Playwright} = alfaPlaywrightModule;
92
93
  const alfaPage = await Playwright.toPage(doc);
94
+ const alfaActModule = await import('@siteimprove/alfa-act');
95
+ const {Audit} = alfaActModule;
93
96
  const audit = Audit.of(alfaPage, alfaRules);
94
97
  const outcomes = Array.from(await doBy(timeLimit, audit, 'evaluate', [], 'alfa testing'));
95
98
  // If the testing finished on time: