Skip to content

Commit 1718c94

Browse files
committed
skip the crossing budget test under coverage
1 parent 847b364 commit 1718c94

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎tests/svg-dos.js‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ const timed = async (name, svg, limit = 5000) => {
2121
(async () => {
2222
// shapes whose edges cross every row of the image tens of thousands of times: a LimitError (the work is bounded), and
2323
// quickly (thousands of huge overlapping strokes took 38 s from 51 KB of SVG)
24-
{
24+
// (not under coverage: reaching the budget takes 20 seconds there, which is most of what a test may take)
25+
if (!process.env.NODE_V8_COVERAGE) {
2526
let d = '';
26-
for (let i = 0; i < 40000; i++) d += `M${(i % 7) / 10} 0h1v300h-1z`;
27+
for (let i = 0; i < 16000; i++) d += `M${(i % 7) / 10} 0h1v300h-1z`;
2728
const {error, time} = await timed('edges crossing every row', `<svg ${NS} width="1" height="300"><path d="${d}"/></svg>`, 10000);
2829
if (!error || error.name !== 'LimitError') panic(`edges crossing every row: expected a LimitError, got ${error} after ${time} ms`);
2930
}

0 commit comments

Comments
 (0)