Speed up a link preview fetch test
This commit is contained in:
parent
ff20c652d2
commit
7efa4f1a8a
1 changed files with 3 additions and 6 deletions
|
@ -844,8 +844,6 @@ describe('link preview fetching', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('stops reading bodies after 500 kilobytes', async function test() {
|
it('stops reading bodies after 500 kilobytes', async function test() {
|
||||||
this.timeout(10000);
|
|
||||||
|
|
||||||
const shouldNeverBeCalled = sinon.stub();
|
const shouldNeverBeCalled = sinon.stub();
|
||||||
|
|
||||||
const fakeFetch = stub().resolves(
|
const fakeFetch = stub().resolves(
|
||||||
|
@ -854,10 +852,9 @@ describe('link preview fetching', () => {
|
||||||
yield new TextEncoder().encode(
|
yield new TextEncoder().encode(
|
||||||
'<!doctype html><head><title>foo bar</title>'
|
'<!doctype html><head><title>foo bar</title>'
|
||||||
);
|
);
|
||||||
const spaces = new Uint8Array(1024).fill(32);
|
const spaces = new Uint8Array(250 * 1024).fill(32);
|
||||||
for (let i = 0; i < 500; i += 1) {
|
yield spaces;
|
||||||
yield spaces;
|
yield spaces;
|
||||||
}
|
|
||||||
shouldNeverBeCalled();
|
shouldNeverBeCalled();
|
||||||
yield new TextEncoder().encode(
|
yield new TextEncoder().encode(
|
||||||
'<meta property="og:description" content="should be ignored">'
|
'<meta property="og:description" content="should be ignored">'
|
||||||
|
|
Loading…
Add table
Reference in a new issue