Skip to content

Commit 16e73d1

Browse files
committed
Failing (non-completing) tests for infinite loop in Cell.drawEmpty()
1 parent f31f195 commit 16e73d1

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

test/issues/296-test.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
const Table = require('../..');
2+
3+
/**
4+
* This test doesn't actually fail it never completes. I could not find a method
5+
* to get the infinite loop to timeout within the test. Not sure how GHA will
6+
* handle this.
7+
*/
8+
test('it should not loop infinitely with invalid table data', async () => {
9+
const table = new Table();
10+
table.push(
11+
[
12+
{ content: 'A', colSpan: 2 },
13+
{ content: 'B', rowSpan: 3 },
14+
],
15+
[],
16+
[{ content: 'C', colSpan: 3 }]
17+
);
18+
expect(() => table.toString()).not.toThrow();
19+
});
20+
21+
test('it should not error on invalid table data', () => {
22+
const table = new Table();
23+
table.push(
24+
[
25+
{ content: 'A', colSpan: 2 },
26+
{ content: 'B', rowSpan: 3 },
27+
],
28+
[{ content: 'C', colSpan: 3 }]
29+
);
30+
expect(() => table.toString()).not.toThrow();
31+
});

0 commit comments

Comments
 (0)