From dbafe3bb4e825b8706137c670b8b34539e14b1e1 Mon Sep 17 00:00:00 2001 From: Pavel Feldman Date: Thu, 7 Apr 2022 12:26:50 -0800 Subject: [PATCH] chore: use utils via index export (1) (#13398) --- packages/playwright-core/package.json | 3 +- .../playwright-core/src/client/browserType.ts | 2 +- .../playwright-core/src/client/network.ts | 4 +- packages/playwright-core/src/outofprocess.ts | 2 +- .../playwright-core/src/server/artifact.ts | 2 +- .../src/server/chromium/chromium.ts | 2 +- .../dispatchers/localUtilsDispatcher.ts | 2 +- .../src/server/firefox/ffPage.ts | 2 +- packages/playwright-core/src/server/frames.ts | 2 +- .../playwright-core/src/server/javascript.ts | 2 +- .../playwright-core/src/server/network.ts | 2 +- packages/playwright-core/src/server/page.ts | 2 +- .../playwright-core/src/server/progress.ts | 2 +- .../src/server/screenshotter.ts | 2 +- .../src/server/supplements/har/harTracer.ts | 2 +- .../server/supplements/recorderSupplement.ts | 2 +- .../src/server/trace/recorder/tracing.ts | 2 +- .../server/webkit/wkInterceptableRequest.ts | 2 +- .../src/server/webkit/wkPage.ts | 2 +- packages/playwright-core/src/utils/index.ts | 19 +++++++ .../src/utils/manualPromise.ts | 55 +++++++++++++++++++ .../src/utils/{async.ts => timeoutRunner.ts} | 42 +------------- packages/playwright-test/src/dispatcher.ts | 2 +- packages/playwright-test/src/expect.ts | 2 +- packages/playwright-test/src/fixtures.ts | 2 +- packages/playwright-test/src/reporters/raw.ts | 2 +- packages/playwright-test/src/runner.ts | 2 +- .../playwright-test/src/timeoutManager.ts | 2 +- packages/playwright-test/src/webServer.ts | 2 +- packages/playwright-test/src/workerRunner.ts | 2 +- 30 files changed, 104 insertions(+), 69 deletions(-) create mode 100644 packages/playwright-core/src/utils/index.ts create mode 100644 packages/playwright-core/src/utils/manualPromise.ts rename packages/playwright-core/src/utils/{async.ts => timeoutRunner.ts} (80%) diff --git a/packages/playwright-core/package.json b/packages/playwright-core/package.json index aa934e5334..79c2cf1faa 100644 --- a/packages/playwright-core/package.json +++ b/packages/playwright-core/package.json @@ -22,10 +22,9 @@ "./lib/grid/gridClient": "./lib/grid/gridClient.js", "./lib/grid/dockerGridFactory": "./lib/grid/dockerGridFactory.js", "./lib/outofprocess": "./lib/outofprocess.js", - "./lib/utils/async": "./lib/utils/async.js", + "./lib/utils": "./lib/utils/index.js", "./lib/utils/comparators": "./lib/utils/comparators.js", "./lib/utils/httpServer": "./lib/utils/httpServer.js", - "./lib/utils/multimap": "./lib/utils/multimap.js", "./lib/utils/processLauncher": "./lib/utils/processLauncher.js", "./lib/utils/utils": "./lib/utils/utils.js", "./lib/utils/stackTrace": "./lib/utils/stackTrace.js", diff --git a/packages/playwright-core/src/client/browserType.ts b/packages/playwright-core/src/client/browserType.ts index 1a1e6a6318..10dea84945 100644 --- a/packages/playwright-core/src/client/browserType.ts +++ b/packages/playwright-core/src/client/browserType.ts @@ -26,7 +26,7 @@ import { envObjectToArray } from './clientHelper'; import { assert, headersObjectToArray, monotonicTime } from '../utils/utils'; import type * as api from '../../types/types'; import { kBrowserClosedError } from '../utils/errors'; -import { raceAgainstTimeout } from '../utils/async'; +import { raceAgainstTimeout } from '../utils'; import type { Playwright } from './playwright'; export interface BrowserServerLauncher { diff --git a/packages/playwright-core/src/client/network.ts b/packages/playwright-core/src/client/network.ts index d5c96b4561..a565d5080c 100644 --- a/packages/playwright-core/src/client/network.ts +++ b/packages/playwright-core/src/client/network.ts @@ -22,14 +22,14 @@ import type { Headers, RemoteAddr, SecurityDetails, WaitForEventOptions } from ' import fs from 'fs'; import * as mime from 'mime'; import { isString, headersObjectToArray } from '../utils/utils'; -import { ManualPromise } from '../utils/async'; +import { ManualPromise } from '../utils'; import { Events } from './events'; import type { Page } from './page'; import { Waiter } from './waiter'; import type * as api from '../../types/types'; import type { HeadersArray, URLMatch } from '../common/types'; import { urlMatches } from './clientHelper'; -import { MultiMap } from '../utils/multimap'; +import { MultiMap } from '../utils'; import { APIResponse } from './fetch'; export type NetworkCookie = { diff --git a/packages/playwright-core/src/outofprocess.ts b/packages/playwright-core/src/outofprocess.ts index 68c5b31882..a3da11e2b0 100644 --- a/packages/playwright-core/src/outofprocess.ts +++ b/packages/playwright-core/src/outofprocess.ts @@ -19,7 +19,7 @@ import { IpcTransport } from './protocol/transport'; import type { Playwright } from './client/playwright'; import * as childProcess from 'child_process'; import * as path from 'path'; -import { ManualPromise } from './utils/async'; +import { ManualPromise } from './utils'; export async function start(env: any = {}): Promise<{ playwright: Playwright, stop: () => Promise }> { const client = new PlaywrightClient(env); diff --git a/packages/playwright-core/src/server/artifact.ts b/packages/playwright-core/src/server/artifact.ts index 0868ef19a8..85aaff8a0c 100644 --- a/packages/playwright-core/src/server/artifact.ts +++ b/packages/playwright-core/src/server/artifact.ts @@ -16,7 +16,7 @@ import fs from 'fs'; import { assert } from '../utils/utils'; -import { ManualPromise } from '../utils/async'; +import { ManualPromise } from '../utils'; import { SdkObject } from './instrumentation'; type SaveCallback = (localPath: string, error?: string) => Promise; diff --git a/packages/playwright-core/src/server/chromium/chromium.ts b/packages/playwright-core/src/server/chromium/chromium.ts index 7dc95ad6c2..00ec9634db 100644 --- a/packages/playwright-core/src/server/chromium/chromium.ts +++ b/packages/playwright-core/src/server/chromium/chromium.ts @@ -41,7 +41,7 @@ import type { CallMetadata } from '../instrumentation'; import http from 'http'; import https from 'https'; import { registry } from '../registry'; -import { ManualPromise } from '../../utils/async'; +import { ManualPromise } from '../../utils'; const ARTIFACTS_FOLDER = path.join(os.tmpdir(), 'playwright-artifacts-'); diff --git a/packages/playwright-core/src/server/dispatchers/localUtilsDispatcher.ts b/packages/playwright-core/src/server/dispatchers/localUtilsDispatcher.ts index 48919b846b..748b406b34 100644 --- a/packages/playwright-core/src/server/dispatchers/localUtilsDispatcher.ts +++ b/packages/playwright-core/src/server/dispatchers/localUtilsDispatcher.ts @@ -20,7 +20,7 @@ import path from 'path'; import yauzl from 'yauzl'; import yazl from 'yazl'; import type * as channels from '../../protocol/channels'; -import { ManualPromise } from '../../utils/async'; +import { ManualPromise } from '../../utils'; import { assert, createGuid } from '../../utils/utils'; import type { DispatcherScope } from './dispatcher'; import { Dispatcher } from './dispatcher'; diff --git a/packages/playwright-core/src/server/firefox/ffPage.ts b/packages/playwright-core/src/server/firefox/ffPage.ts index 951d3ac807..b939c07ba0 100644 --- a/packages/playwright-core/src/server/firefox/ffPage.ts +++ b/packages/playwright-core/src/server/firefox/ffPage.ts @@ -34,7 +34,7 @@ import type { Protocol } from './protocol'; import type { Progress } from '../progress'; import { splitErrorMessage } from '../../utils/stackTrace'; import { debugLogger } from '../../utils/debugLogger'; -import { ManualPromise } from '../../utils/async'; +import { ManualPromise } from '../../utils'; export const UTILITY_WORLD_NAME = '__playwright_utility_world__'; diff --git a/packages/playwright-core/src/server/frames.ts b/packages/playwright-core/src/server/frames.ts index 93e372b29d..c80b6fff02 100644 --- a/packages/playwright-core/src/server/frames.ts +++ b/packages/playwright-core/src/server/frames.ts @@ -30,7 +30,7 @@ import { BrowserContext } from './browserContext'; import type { Progress } from './progress'; import { ProgressController } from './progress'; import { assert, constructURLBasedOnBaseURL, makeWaitForNextTask } from '../utils/utils'; -import { ManualPromise } from '../utils/async'; +import { ManualPromise } from '../utils'; import { debugLogger } from '../utils/debugLogger'; import type { CallMetadata } from './instrumentation'; import { serverSideCallMetadata, SdkObject } from './instrumentation'; diff --git a/packages/playwright-core/src/server/javascript.ts b/packages/playwright-core/src/server/javascript.ts index 8d48cd615b..00168dacae 100644 --- a/packages/playwright-core/src/server/javascript.ts +++ b/packages/playwright-core/src/server/javascript.ts @@ -19,7 +19,7 @@ import * as utilityScriptSource from '../generated/utilityScriptSource'; import { serializeAsCallArgument } from './common/utilityScriptSerializers'; import { type UtilityScript } from './injected/utilityScript'; import { SdkObject } from './instrumentation'; -import { ManualPromise } from '../utils/async'; +import { ManualPromise } from '../utils'; export type ObjectId = string; export type RemoteObject = { diff --git a/packages/playwright-core/src/server/network.ts b/packages/playwright-core/src/server/network.ts index 2e173bab23..e85a743441 100644 --- a/packages/playwright-core/src/server/network.ts +++ b/packages/playwright-core/src/server/network.ts @@ -18,7 +18,7 @@ import type * as frames from './frames'; import type * as types from './types'; import type * as channels from '../protocol/channels'; import { assert } from '../utils/utils'; -import { ManualPromise } from '../utils/async'; +import { ManualPromise } from '../utils'; import { SdkObject } from './instrumentation'; import type { NameValue } from '../common/types'; import { APIRequestContext } from './fetch'; diff --git a/packages/playwright-core/src/server/page.ts b/packages/playwright-core/src/server/page.ts index cb7435ae5a..7ecff6cf5b 100644 --- a/packages/playwright-core/src/server/page.ts +++ b/packages/playwright-core/src/server/page.ts @@ -31,7 +31,7 @@ import { FileChooser } from './fileChooser'; import type { Progress } from './progress'; import { ProgressController } from './progress'; import { assert, isError } from '../utils/utils'; -import { ManualPromise } from '../utils/async'; +import { ManualPromise } from '../utils'; import { debugLogger } from '../utils/debugLogger'; import type { ImageComparatorOptions } from '../utils/comparators'; import { getComparator } from '../utils/comparators'; diff --git a/packages/playwright-core/src/server/progress.ts b/packages/playwright-core/src/server/progress.ts index d2e312a196..1978c96d5c 100644 --- a/packages/playwright-core/src/server/progress.ts +++ b/packages/playwright-core/src/server/progress.ts @@ -19,7 +19,7 @@ import { assert, monotonicTime } from '../utils/utils'; import type { LogName } from '../utils/debugLogger'; import type { CallMetadata, Instrumentation, SdkObject } from './instrumentation'; import type { ElementHandle } from './dom'; -import { ManualPromise } from '../utils/async'; +import { ManualPromise } from '../utils'; import type { LogEntry } from './injected/injectedScript'; export interface Progress { diff --git a/packages/playwright-core/src/server/screenshotter.ts b/packages/playwright-core/src/server/screenshotter.ts index 27b20f482d..3228a06448 100644 --- a/packages/playwright-core/src/server/screenshotter.ts +++ b/packages/playwright-core/src/server/screenshotter.ts @@ -24,7 +24,7 @@ import type { ParsedSelector } from './common/selectorParser'; import type * as types from './types'; import type { Progress } from './progress'; import { assert } from '../utils/utils'; -import { MultiMap } from '../utils/multimap'; +import { MultiMap } from '../utils'; declare global { interface Window { diff --git a/packages/playwright-core/src/server/supplements/har/harTracer.ts b/packages/playwright-core/src/server/supplements/har/harTracer.ts index ec289575b1..47b23d5394 100644 --- a/packages/playwright-core/src/server/supplements/har/harTracer.ts +++ b/packages/playwright-core/src/server/supplements/har/harTracer.ts @@ -25,7 +25,7 @@ import { calculateSha1, monotonicTime } from '../../../utils/utils'; import type { RegisteredListener } from '../../../utils/eventsHelper'; import { eventsHelper } from '../../../utils/eventsHelper'; import * as mime from 'mime'; -import { ManualPromise } from '../../../utils/async'; +import { ManualPromise } from '../../../utils'; const FALLBACK_HTTP_VERSION = 'HTTP/1.1'; diff --git a/packages/playwright-core/src/server/supplements/recorderSupplement.ts b/packages/playwright-core/src/server/supplements/recorderSupplement.ts index 38a0198582..7e00a7007a 100644 --- a/packages/playwright-core/src/server/supplements/recorderSupplement.ts +++ b/packages/playwright-core/src/server/supplements/recorderSupplement.ts @@ -38,7 +38,7 @@ import { createGuid, monotonicTime } from '../../utils/utils'; import { metadataToCallLog } from './recorder/recorderUtils'; import { Debugger } from './debugger'; import { EventEmitter } from 'events'; -import { raceAgainstTimeout } from '../../utils/async'; +import { raceAgainstTimeout } from '../../utils'; type BindingSource = { frame: Frame, page: Page }; diff --git a/packages/playwright-core/src/server/trace/recorder/tracing.ts b/packages/playwright-core/src/server/trace/recorder/tracing.ts index 98e218acc0..ac47e871e0 100644 --- a/packages/playwright-core/src/server/trace/recorder/tracing.ts +++ b/packages/playwright-core/src/server/trace/recorder/tracing.ts @@ -22,7 +22,7 @@ import yazl from 'yazl'; import type { NameValue } from '../../../common/types'; import type { TracingTracingStopChunkParams } from '../../../protocol/channels'; import { commandsWithTracingSnapshots } from '../../../protocol/channels'; -import { ManualPromise } from '../../../utils/async'; +import { ManualPromise } from '../../../utils'; import type { RegisteredListener } from '../../../utils/eventsHelper'; import { eventsHelper } from '../../../utils/eventsHelper'; import { assert, calculateSha1, createGuid, mkdirIfNeeded, monotonicTime, removeFolders } from '../../../utils/utils'; diff --git a/packages/playwright-core/src/server/webkit/wkInterceptableRequest.ts b/packages/playwright-core/src/server/webkit/wkInterceptableRequest.ts index c8e9389438..de1eade0f8 100644 --- a/packages/playwright-core/src/server/webkit/wkInterceptableRequest.ts +++ b/packages/playwright-core/src/server/webkit/wkInterceptableRequest.ts @@ -21,7 +21,7 @@ import type * as types from '../types'; import type { Protocol } from './protocol'; import type { WKSession } from './wkConnection'; import { assert, headersObjectToArray, headersArrayToObject } from '../../utils/utils'; -import { ManualPromise } from '../../utils/async'; +import { ManualPromise } from '../../utils'; const errorReasons: { [reason: string]: Protocol.Network.ResourceErrorType } = { 'aborted': 'Cancellation', diff --git a/packages/playwright-core/src/server/webkit/wkPage.ts b/packages/playwright-core/src/server/webkit/wkPage.ts index caf9e58444..7f96f0be47 100644 --- a/packages/playwright-core/src/server/webkit/wkPage.ts +++ b/packages/playwright-core/src/server/webkit/wkPage.ts @@ -43,7 +43,7 @@ import { WKInterceptableRequest, WKRouteImpl } from './wkInterceptableRequest'; import { WKProvisionalPage } from './wkProvisionalPage'; import { WKWorkers } from './wkWorkers'; import { debugLogger } from '../../utils/debugLogger'; -import { ManualPromise } from '../../utils/async'; +import { ManualPromise } from '../../utils'; const UTILITY_WORLD_NAME = '__playwright_utility_world__'; const BINDING_CALL_MESSAGE = '__playwright_binding_call__'; diff --git a/packages/playwright-core/src/utils/index.ts b/packages/playwright-core/src/utils/index.ts new file mode 100644 index 0000000000..7b6f1b2958 --- /dev/null +++ b/packages/playwright-core/src/utils/index.ts @@ -0,0 +1,19 @@ +/** + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { ManualPromise } from './manualPromise'; +export { MultiMap } from './multimap'; +export { raceAgainstTimeout, TimeoutRunner, TimeoutRunnerError } from './timeoutRunner'; diff --git a/packages/playwright-core/src/utils/manualPromise.ts b/packages/playwright-core/src/utils/manualPromise.ts new file mode 100644 index 0000000000..18b0aaf910 --- /dev/null +++ b/packages/playwright-core/src/utils/manualPromise.ts @@ -0,0 +1,55 @@ +/** + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class ManualPromise extends Promise { + private _resolve!: (t: T) => void; + private _reject!: (e: Error) => void; + private _isDone: boolean; + + constructor() { + let resolve: (t: T) => void; + let reject: (e: Error) => void; + super((f, r) => { + resolve = f; + reject = r; + }); + this._isDone = false; + this._resolve = resolve!; + this._reject = reject!; + } + + isDone() { + return this._isDone; + } + + resolve(t: T) { + this._isDone = true; + this._resolve(t); + } + + reject(e: Error) { + this._isDone = true; + this._reject(e); + } + + static override get [Symbol.species]() { + return Promise; + } + + override get [Symbol.toStringTag]() { + return 'ManualPromise'; + } +} diff --git a/packages/playwright-core/src/utils/async.ts b/packages/playwright-core/src/utils/timeoutRunner.ts similarity index 80% rename from packages/playwright-core/src/utils/async.ts rename to packages/playwright-core/src/utils/timeoutRunner.ts index 2648fcaac8..4da10e7c44 100644 --- a/packages/playwright-core/src/utils/async.ts +++ b/packages/playwright-core/src/utils/timeoutRunner.ts @@ -14,6 +14,7 @@ * limitations under the License. */ +import { ManualPromise } from './manualPromise'; import { monotonicTime } from './utils'; export class TimeoutRunnerError extends Error {} @@ -23,6 +24,7 @@ type TimeoutRunnerData = { timer: NodeJS.Timer | undefined, timeoutPromise: ManualPromise, }; + export class TimeoutRunner { private _running: TimeoutRunnerData | undefined; private _timeout: number; @@ -107,43 +109,3 @@ export async function raceAgainstTimeout(cb: () => Promise, timeout: numbe throw e; } } - -export class ManualPromise extends Promise { - private _resolve!: (t: T) => void; - private _reject!: (e: Error) => void; - private _isDone: boolean; - - constructor() { - let resolve: (t: T) => void; - let reject: (e: Error) => void; - super((f, r) => { - resolve = f; - reject = r; - }); - this._isDone = false; - this._resolve = resolve!; - this._reject = reject!; - } - - isDone() { - return this._isDone; - } - - resolve(t: T) { - this._isDone = true; - this._resolve(t); - } - - reject(e: Error) { - this._isDone = true; - this._reject(e); - } - - static override get [Symbol.species]() { - return Promise; - } - - override get [Symbol.toStringTag]() { - return 'ManualPromise'; - } -} diff --git a/packages/playwright-test/src/dispatcher.ts b/packages/playwright-test/src/dispatcher.ts index 8412206894..1ee2a4cf4c 100644 --- a/packages/playwright-test/src/dispatcher.ts +++ b/packages/playwright-test/src/dispatcher.ts @@ -21,7 +21,7 @@ import type { RunPayload, TestBeginPayload, TestEndPayload, DonePayload, TestOut import type { TestResult, Reporter, TestStep, TestError } from '../types/testReporter'; import type { Suite, TestCase } from './test'; import type { Loader } from './loader'; -import { ManualPromise } from 'playwright-core/lib/utils/async'; +import { ManualPromise } from 'playwright-core/lib/utils'; export type TestGroup = { workerHash: string; diff --git a/packages/playwright-test/src/expect.ts b/packages/playwright-test/src/expect.ts index 12c3697e9c..ff68fb9c06 100644 --- a/packages/playwright-test/src/expect.ts +++ b/packages/playwright-test/src/expect.ts @@ -15,7 +15,7 @@ */ import expectLibrary from 'expect'; -import { raceAgainstTimeout } from 'playwright-core/lib/utils/async'; +import { raceAgainstTimeout } from 'playwright-core/lib/utils'; import path from 'path'; import { INVERTED_COLOR, diff --git a/packages/playwright-test/src/fixtures.ts b/packages/playwright-test/src/fixtures.ts index e592d1a5a6..60a21cd790 100644 --- a/packages/playwright-test/src/fixtures.ts +++ b/packages/playwright-test/src/fixtures.ts @@ -17,7 +17,7 @@ import { formatLocation, debugTest } from './util'; import * as crypto from 'crypto'; import type { FixturesWithLocation, Location, WorkerInfo } from './types'; -import { ManualPromise } from 'playwright-core/lib/utils/async'; +import { ManualPromise } from 'playwright-core/lib/utils'; import type { TestInfoImpl } from './testInfo'; import type { FixtureDescription, TimeoutManager } from './timeoutManager'; diff --git a/packages/playwright-test/src/reporters/raw.ts b/packages/playwright-test/src/reporters/raw.ts index 81974e900e..aa150bbf86 100644 --- a/packages/playwright-test/src/reporters/raw.ts +++ b/packages/playwright-test/src/reporters/raw.ts @@ -21,7 +21,7 @@ import { assert, calculateSha1 } from 'playwright-core/lib/utils/utils'; import { sanitizeForFilePath } from '../util'; import { formatResultFailure } from './base'; import { toPosixPath, serializePatterns } from './json'; -import { MultiMap } from 'playwright-core/lib/utils/multimap'; +import { MultiMap } from 'playwright-core/lib/utils'; import { codeFrameColumns } from '@babel/code-frame'; import type { FullConfigInternal } from '../types'; diff --git a/packages/playwright-test/src/runner.ts b/packages/playwright-test/src/runner.ts index 369a6d59f2..aa08e79fa7 100644 --- a/packages/playwright-test/src/runner.ts +++ b/packages/playwright-test/src/runner.ts @@ -42,7 +42,7 @@ import { Minimatch } from 'minimatch'; import type { Config } from './types'; import type { FullConfigInternal } from './types'; import { WebServer } from './webServer'; -import { raceAgainstTimeout } from 'playwright-core/lib/utils/async'; +import { raceAgainstTimeout } from 'playwright-core/lib/utils'; import { SigIntWatcher } from 'playwright-core/lib/utils/utils'; const removeFolderAsync = promisify(rimraf); diff --git a/packages/playwright-test/src/timeoutManager.ts b/packages/playwright-test/src/timeoutManager.ts index e6bad9e172..f2d92488e7 100644 --- a/packages/playwright-test/src/timeoutManager.ts +++ b/packages/playwright-test/src/timeoutManager.ts @@ -15,7 +15,7 @@ */ import colors from 'colors/safe'; -import { TimeoutRunner, TimeoutRunnerError } from 'playwright-core/lib/utils/async'; +import { TimeoutRunner, TimeoutRunnerError } from 'playwright-core/lib/utils'; import type { TestError } from '../types/test'; import type { Location } from './types'; diff --git a/packages/playwright-test/src/webServer.ts b/packages/playwright-test/src/webServer.ts index 3127347bc1..86dd4206ec 100644 --- a/packages/playwright-test/src/webServer.ts +++ b/packages/playwright-test/src/webServer.ts @@ -18,7 +18,7 @@ import http from 'http'; import https from 'https'; import net from 'net'; import debug from 'debug'; -import { raceAgainstTimeout } from 'playwright-core/lib/utils/async'; +import { raceAgainstTimeout } from 'playwright-core/lib/utils'; import type { WebServerConfig } from './types'; import { launchProcess } from 'playwright-core/lib/utils/processLauncher'; import type { Reporter } from '../types/testReporter'; diff --git a/packages/playwright-test/src/workerRunner.ts b/packages/playwright-test/src/workerRunner.ts index c8db16c9c2..b1db516d44 100644 --- a/packages/playwright-test/src/workerRunner.ts +++ b/packages/playwright-test/src/workerRunner.ts @@ -26,7 +26,7 @@ import type { Suite, TestCase } from './test'; import type { Annotation, TestError, TestStepInternal } from './types'; import type { ProjectImpl } from './project'; import { FixtureRunner } from './fixtures'; -import { ManualPromise } from 'playwright-core/lib/utils/async'; +import { ManualPromise } from 'playwright-core/lib/utils'; import { TestInfoImpl } from './testInfo'; import type { TimeSlot } from './timeoutManager'; import { TimeoutManager } from './timeoutManager';