testaro 60.10.1 → 60.10.2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testaro",
3
- "version": "60.10.1",
3
+ "version": "60.10.2",
4
4
  "description": "Run 1000 web accessibility tests from 11 tools and get a standardized report",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/procs/identify.js CHANGED
@@ -85,15 +85,16 @@ const addIDs = async (locator, recipient) => {
85
85
  const timer = new Promise(resolve => {
86
86
  timeout = setTimeout(() => {
87
87
  resolve({timedOut: true})
88
- clearTimeout(timeout);
89
88
  }, 500);
90
89
  });
91
90
  // Use Playwright to get the XPath.
92
91
  const pathIDPromise = xPath(locator);
93
92
  const pathID = await Promise.race([pathIDPromise, timer]);
94
- // If the XPath was computed:
93
+ // If the XPath was computed before being timed out:
95
94
  if (typeof pathID === 'string') {
96
- // Add it to the result.
95
+ // Prevent the timeout from resolving.
96
+ clearTimeout(timeout);
97
+ // Add the XPath to the result.
97
98
  recipient.pathID = pathID;
98
99
  }
99
100
  }