mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
fix(test-runner): set expand: false for expect. (#7722)
This commit is contained in:
parent
642d6d4459
commit
0cf9cf0829
@ -58,3 +58,4 @@ function toMatchSnapshot(this: ReturnType<Expect['getState']>, received: Buffer
|
||||
}
|
||||
|
||||
expectLibrary.extend({ toMatchSnapshot });
|
||||
expectLibrary.setState({ expand: false });
|
||||
@ -125,3 +125,20 @@ test('should work with custom PlaywrightTest namespace', async ({runTSC}) => {
|
||||
});
|
||||
expect(result.exitCode).toBe(0);
|
||||
});
|
||||
|
||||
test('should not expand huge arrays', async ({runInlineTest}) => {
|
||||
const result = await runInlineTest({
|
||||
'expect-test.spec.ts': `
|
||||
const { test } = pwt;
|
||||
test('numeric ranges', () => {
|
||||
const a1 = Array(100000).fill(1);
|
||||
const a2 = Array(100000).fill(1);
|
||||
a2[500] = 2;
|
||||
test.expect(a1).toEqual(a2);
|
||||
});
|
||||
`
|
||||
});
|
||||
expect(result.exitCode).toBe(1);
|
||||
expect(result.passed).toBe(0);
|
||||
expect(result.output.length).toBeLessThan(100000);
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user