Skip to content

Commit bf818df

Browse files
removing jest timeout but leaving a comment (also logged)
1 parent b2dbb8f commit bf818df

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

src/views/component-viewer/test/integration/parser-evaluator/parser/parser-scvd-expressions.test.ts

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919

2020
import { parseExpression, ParseResult } from '../../../../parser-evaluator/parser';
2121

22-
jest.setTimeout(60000);
22+
/* If tests are timing out, increase the timeout value here:
23+
* jest.setTimeout(10000);
24+
*/
2325

2426
interface ExpressionRow {
2527
expr: string;
@@ -62,12 +64,21 @@ function parseAll(rows: ExpressionRow[]): { parsed: ParseResult[]; diagnostics:
6264

6365
describe('Parser over SCVD expression fixtures', () => {
6466
it('parses every expression without throwing', () => {
67+
const timeoutHint = setTimeout(() => {
68+
// If this prints, the default Jest timeout is likely to be hit.
69+
// eslint-disable-next-line no-console
70+
console.warn('Parser SCVD expressions test is running long; consider increasing the test timeout or reducing fixture size.');
71+
}, 4500);
6572
const { _meta, expressions } = readExpressions('expressions.json');
66-
expect(expressions.length).toBe(_meta.totalUnique);
73+
try {
74+
expect(expressions.length).toBe(_meta.totalUnique);
6775

68-
const { diagnostics } = parseAll(expressions);
76+
const { diagnostics } = parseAll(expressions);
6977

70-
// The parser should be tolerant; fail hard if diagnostics explode unexpectedly.
71-
expect(diagnostics).toBeGreaterThanOrEqual(0);
78+
// The parser should be tolerant; fail hard if diagnostics explode unexpectedly.
79+
expect(diagnostics).toBeGreaterThanOrEqual(0);
80+
} finally {
81+
clearTimeout(timeoutHint);
82+
}
7283
});
7384
});

0 commit comments

Comments
 (0)