test: use delay() helper (#24321)

This commit is contained in:
Milan Burda 2020-06-26 22:59:54 +02:00 committed by GitHub
parent 8eb198bab4
commit 1c49e4e376
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 24 additions and 36 deletions

View file

@ -11,6 +11,7 @@ import { EventEmitter } from 'events';
import { closeWindow } from './window-helpers';
import { emittedOnce } from './events-helpers';
import { WebmGenerator } from './video-helpers';
import { delay } from './spec-helpers';
const fixturesPath = path.resolve(__dirname, '..', 'spec', 'fixtures');
@ -33,12 +34,6 @@ const postData = {
type: 'string'
};
function delay (ms: number) {
return new Promise((resolve) => {
setTimeout(resolve, ms);
});
}
function getStream (chunkSize = text.length, data: Buffer | string = text) {
const body = new stream.PassThrough();