Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove 'as *' imports because of esModuleInterop: true #34854

Merged
merged 1 commit into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/src/auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Create `tests/auth.setup.ts` that will prepare authenticated browser state for a

```js title="tests/auth.setup.ts"
import { test as setup, expect } from '@playwright/test';
import * as path from 'path';
import path from 'path';

const authFile = path.join(__dirname, '../playwright/.auth/user.json');

Expand Down Expand Up @@ -143,8 +143,8 @@ Create `playwright/fixtures.ts` file that will [override `storageState` fixture]

```js title="playwright/fixtures.ts"
import { test as baseTest, expect } from '@playwright/test';
import * as fs from 'fs';
import * as path from 'path';
import fs from 'fs';
import path from 'path';

export * from '@playwright/test';
export const test = baseTest.extend<{}, { workerStorageState: string }>({
Expand Down Expand Up @@ -348,8 +348,8 @@ Alternatively, in a [worker fixture](#moderate-one-account-per-parallel-worker):

```js title="playwright/fixtures.ts"
import { test as baseTest, request } from '@playwright/test';
import * as fs from 'fs';
import * as path from 'path';
import fs from 'fs';
import path from 'path';

export * from '@playwright/test';
export const test = baseTest.extend<{}, { workerStorageState: string }>({
Expand Down
2 changes: 1 addition & 1 deletion docs/src/chrome-extensions-js-python.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ First, add fixtures that will load the extension:

```js title="fixtures.ts"
import { test as base, chromium, type BrowserContext } from '@playwright/test';
import * as path from 'path';
import path from 'path';

export const test = base.extend<{
context: BrowserContext;
Expand Down
2 changes: 1 addition & 1 deletion docs/src/evaluating.md
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ Next, add init script to the page.

```js
import { test, expect } from '@playwright/test';
import * as path from 'path';
import path from 'path';

test.beforeEach(async ({ page }) => {
// Add script for every test in the beforeEach hook.
Expand Down
2 changes: 1 addition & 1 deletion docs/src/test-api/class-testconfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ Here is an example that uses [`method: TestInfo.outputPath`] to create a tempora

```js
import { test, expect } from '@playwright/test';
import * as fs from 'fs';
import fs from 'fs';

test('example test', async ({}, testInfo) => {
const file = testInfo.outputPath('temporary-file.txt');
Expand Down
2 changes: 1 addition & 1 deletion docs/src/test-api/class-testinfo.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ Returns a path inside the [`property: TestInfo.outputDir`] where the test can sa

```js
import { test, expect } from '@playwright/test';
import * as fs from 'fs';
import fs from 'fs';

test('example test', async ({}, testInfo) => {
const file = testInfo.outputPath('dir', 'temporary-file.txt');
Expand Down
2 changes: 1 addition & 1 deletion docs/src/test-api/class-testproject.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ Here is an example that uses [`method: TestInfo.outputPath`] to create a tempora

```js
import { test, expect } from '@playwright/test';
import * as fs from 'fs';
import fs from 'fs';

test('example test', async ({}, testInfo) => {
const file = testInfo.outputPath('temporary-file.txt');
Expand Down
2 changes: 1 addition & 1 deletion docs/src/test-fixtures-js.md
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ Here is an example fixture that automatically attaches debug logs when the test

```js title="my-test.ts"
import debug from 'debug';
import * as fs from 'fs';
import fs from 'fs';
import { test as base } from '@playwright/test';

export const test = base.extend<{ saveLogs: void }>({
Expand Down
6 changes: 3 additions & 3 deletions docs/src/test-parameterize-js.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ To make environment variables easier to manage, consider something like `.env` f
```js title="playwright.config.ts"
import { defineConfig } from '@playwright/test';
import dotenv from 'dotenv';
import * as path from 'path';
import path from 'path';

// Read from ".env" file.
dotenv.config({ path: path.resolve(__dirname, '.env') });
Expand Down Expand Up @@ -309,8 +309,8 @@ See for example this CSV file, in our example `input.csv`:
Based on this we'll generate some tests by using the [csv-parse](https://www.npmjs.com/package/csv-parse) library from NPM:

```js title="test.spec.ts"
import * as fs from 'fs';
import * as path from 'path';
import fs from 'fs';
import path from 'path';
import { test } from '@playwright/test';
import { parse } from 'csv-parse/sync';

Expand Down
6 changes: 3 additions & 3 deletions docs/src/webview2.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ Using the following, Playwright will run your WebView2 application as a sub-proc

```js title="webView2Test.ts"
import { test as base } from '@playwright/test';
import * as fs from 'fs';
import * as os from 'os';
import * as path from 'path';
import fs from 'fs';
import os from 'os';
import path from 'path';
import childProcess from 'child_process';

const EXECUTABLE_PATH = path.join(
Expand Down
4 changes: 2 additions & 2 deletions packages/html-reporter/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/

import * as fs from 'fs';
import * as path from 'path';
import fs from 'fs';
import path from 'path';
import type { Plugin, UserConfig } from 'vite';

export function bundle(): Plugin {
Expand Down
4 changes: 2 additions & 2 deletions packages/html-reporter/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/

import { devices, defineConfig } from '@playwright/experimental-ct-react';
import * as path from 'path';
import * as url from 'url';
import path from 'path';
import url from 'url';

export default defineConfig({
testDir: 'src',
Expand Down
2 changes: 1 addition & 1 deletion packages/html-reporter/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { bundle } from './bundle';
import * as path from 'path';
import path from 'path';

// https://vitejs.dev/config/
export default defineConfig({
Expand Down
2 changes: 1 addition & 1 deletion packages/playwright-core/src/cli/driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

/* eslint-disable no-console */

import * as fs from 'fs';
import fs from 'fs';

import * as playwright from '../..';
import { PipeTransport } from '../server/utils/pipeTransport';
Expand Down
6 changes: 3 additions & 3 deletions packages/playwright-core/src/cli/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

/* eslint-disable no-console */

import * as fs from 'fs';
import * as os from 'os';
import * as path from 'path';
import fs from 'fs';
import os from 'os';
import path from 'path';

import * as playwright from '../..';
import { launchBrowserServer, printApiJson, runDriver, runServer } from './driver';
Expand Down
2 changes: 1 addition & 1 deletion packages/playwright-core/src/outofprocess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import * as childProcess from 'child_process';
import * as path from 'path';
import path from 'path';

import { createConnectionFactory } from './client/clientBundle';
import { PipeTransport } from './server/utils/pipeTransport';
Expand Down
6 changes: 3 additions & 3 deletions packages/playwright-core/src/server/android/android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
*/

import { EventEmitter } from 'events';
import * as fs from 'fs';
import * as os from 'os';
import * as path from 'path';
import fs from 'fs';
import os from 'os';
import path from 'path';

import { TimeoutSettings } from '../timeoutSettings';
import { PipeTransport } from '../utils/pipeTransport';
Expand Down
2 changes: 1 addition & 1 deletion packages/playwright-core/src/server/android/backendAdb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import { EventEmitter } from 'events';
import * as net from 'net';
import net from 'net';

import { assert } from '../../utils/isomorphic/assert';
import { createGuid } from '../utils/crypto';
Expand Down
2 changes: 1 addition & 1 deletion packages/playwright-core/src/server/artifact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import * as fs from 'fs';
import fs from 'fs';

import { assert } from '../utils';
import { TargetClosedError } from './errors';
Expand Down
2 changes: 1 addition & 1 deletion packages/playwright-core/src/server/bidi/bidiChromium.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import * as os from 'os';
import os from 'os';

import { assert } from '../../utils';
import { wrapInASCIIBox } from '../utils/ascii';
Expand Down
4 changes: 2 additions & 2 deletions packages/playwright-core/src/server/bidi/bidiFirefox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/

import * as os from 'os';
import * as path from 'path';
import os from 'os';
import path from 'path';

import { assert } from '../../utils';
import { wrapInASCIIBox } from '../utils/ascii';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* SPDX-License-Identifier: Apache-2.0
*/

import * as fs from 'fs';
import * as path from 'path';
import fs from 'fs';
import path from 'path';

/* eslint-disable curly, indent */

Expand Down
4 changes: 2 additions & 2 deletions packages/playwright-core/src/server/browserContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
* limitations under the License.
*/

import * as fs from 'fs';
import * as path from 'path';
import fs from 'fs';
import path from 'path';

import { TimeoutSettings } from './timeoutSettings';
import { createGuid } from './utils/crypto';
Expand Down
6 changes: 3 additions & 3 deletions packages/playwright-core/src/server/browserType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
* limitations under the License.
*/

import * as fs from 'fs';
import * as os from 'os';
import * as path from 'path';
import fs from 'fs';
import os from 'os';
import path from 'path';

import { normalizeProxySettings, validateBrowserContextOptions } from './browserContext';
import { DEFAULT_TIMEOUT, TimeoutSettings } from './timeoutSettings';
Expand Down
6 changes: 3 additions & 3 deletions packages/playwright-core/src/server/chromium/chromium.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
* limitations under the License.
*/

import * as fs from 'fs';
import * as os from 'os';
import * as path from 'path';
import fs from 'fs';
import os from 'os';
import path from 'path';

import { chromiumSwitches } from './chromiumSwitches';
import { CRBrowser } from './crBrowser';
Expand Down
2 changes: 1 addition & 1 deletion packages/playwright-core/src/server/chromium/crBrowser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import * as path from 'path';
import path from 'path';

import { assert } from '../../utils/isomorphic/assert';
import { createGuid } from '../utils/crypto';
Expand Down
2 changes: 1 addition & 1 deletion packages/playwright-core/src/server/chromium/crDevTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import * as fs from 'fs';
import fs from 'fs';

import type { CRSession } from './crConnection';

Expand Down
2 changes: 1 addition & 1 deletion packages/playwright-core/src/server/chromium/crPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import * as path from 'path';
import path from 'path';

import { assert } from '../../utils/isomorphic/assert';
import { createGuid } from '../utils/crypto';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import * as fs from 'fs';
import fs from 'fs';

import { splitErrorMessage } from '../../utils/isomorphic/stackTrace';
import { mkdirIfNeeded } from '../utils/fileUtils';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import * as fs from 'fs';
import fs from 'fs';

import { Dispatcher, existingDispatcher } from './dispatcher';
import { StreamDispatcher } from './streamDispatcher';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/

import * as fs from 'fs';
import * as path from 'path';
import fs from 'fs';
import path from 'path';

import { BrowserContext } from '../browserContext';
import { ArtifactDispatcher } from './artifactDispatcher';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import * as fs from 'fs';
import fs from 'fs';

import { Dispatcher } from './dispatcher';
import { createGuid } from '../utils/crypto';
Expand Down
2 changes: 1 addition & 1 deletion packages/playwright-core/src/server/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import * as fs from 'fs';
import fs from 'fs';

import * as js from './javascript';
import { ProgressController } from './progress';
Expand Down
2 changes: 1 addition & 1 deletion packages/playwright-core/src/server/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import * as path from 'path';
import path from 'path';

import { Page } from './page';
import { assert } from '../utils';
Expand Down
6 changes: 3 additions & 3 deletions packages/playwright-core/src/server/electron/electron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
* limitations under the License.
*/

import * as fs from 'fs';
import * as os from 'os';
import * as path from 'path';
import fs from 'fs';
import os from 'os';
import path from 'path';
import * as readline from 'readline';

import { TimeoutSettings } from '../timeoutSettings';
Expand Down
6 changes: 3 additions & 3 deletions packages/playwright-core/src/server/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
* limitations under the License.
*/

import * as http from 'http';
import * as https from 'https';
import http from 'http';
import https from 'https';
import { Transform, pipeline } from 'stream';
import { TLSSocket } from 'tls';
import * as url from 'url';
import url from 'url';
import * as zlib from 'zlib';

import { TimeoutSettings } from './timeoutSettings';
Expand Down
Loading
Loading