testaro 5.6.1 → 5.6.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 +1 -1
- package/tests/continuum.js +19 -4
package/package.json
CHANGED
package/tests/continuum.js
CHANGED
|
@@ -22,11 +22,17 @@ exports.reporter = async page => {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
if (! result.prevented) {
|
|
25
|
-
// Run the Continuum ruleset and get the result.
|
|
25
|
+
// Run the Continuum ruleset and get the result, failing if none within 20 seconds.
|
|
26
26
|
result = await page.evaluate(async () => {
|
|
27
27
|
continuum.setUp(null, null, window);
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
const bigResultPromise = continuum.runAllTests();
|
|
29
|
+
const deadlinePromise = new Promise(resolve => {
|
|
30
|
+
setTimeout(() => {
|
|
31
|
+
resolve('timeout');
|
|
32
|
+
}, 20000);
|
|
33
|
+
});
|
|
34
|
+
const bigResult = await Promise.race([bigResultPromise, deadlinePromise]);
|
|
35
|
+
if (Array.isArray(bigResult)) {
|
|
30
36
|
return bigResult.map(bigItem => {
|
|
31
37
|
const item = bigItem._rawEngineJsonObject;
|
|
32
38
|
delete item.fingerprint.encoding;
|
|
@@ -36,8 +42,17 @@ exports.reporter = async page => {
|
|
|
36
42
|
return item;
|
|
37
43
|
});
|
|
38
44
|
}
|
|
45
|
+
else if (bigResult === 'timeout') {
|
|
46
|
+
return {
|
|
47
|
+
prevented: true,
|
|
48
|
+
error: 'ERROR: Running all tests timed out'
|
|
49
|
+
};
|
|
50
|
+
}
|
|
39
51
|
else {
|
|
40
|
-
return
|
|
52
|
+
return {
|
|
53
|
+
prevented: true,
|
|
54
|
+
error: 'ERROR: Invalid result'
|
|
55
|
+
};
|
|
41
56
|
}
|
|
42
57
|
});
|
|
43
58
|
}
|