diff --git a/src/lib/study-algorithms.js b/src/lib/study-algorithms.js
index 5f5be35..d637fb8 100644
--- a/src/lib/study-algorithms.js
+++ b/src/lib/study-algorithms.js
@@ -76,7 +76,7 @@ function studyAlgorithms(specs) {
function findAnomalyInParallelStep(spec, algo, step) {
if (step.html) {
const html = normalize(step.html);
- if (html.match(/queu(e|ing) an?( \w+){0,2} (micro)?task/i)) {
+ if (html.match(/queu(e|ing) an?( \w+){0,3} (micro)?task/i)) {
return false;
}
if (html.match(/(^|>| )(resolve|reject)(<| )/i) &&
diff --git a/test/study-algorithms.js b/test/study-algorithms.js
index f12c52f..c40c8f2 100644
--- a/test/study-algorithms.js
+++ b/test/study-algorithms.js
@@ -34,4 +34,23 @@ describe('The algorithms analyser', () => {
spec: { url: 'https://www.w3.org/TR/spec' }
});
});
+
+ it('reports no anomaly when a step queues a custom task', () => {
+ const crawlResult = toCrawlResult([
+ {
+ html: 'The custom() method MUST run the following steps:',
+ rationale: 'if',
+ steps: [
+ { html: 'Let p be a new promise.' },
+ { html: 'In parallel',
+ steps: [
+ { html: 'Queue a custom but fantastic task to resolve p with undefined' }
+ ]
+ }
+ ]
+ }
+ ]);
+ const report = study(crawlResult);
+ assertNbAnomalies(report, 0);
+ });
});
\ No newline at end of file