Skip to content

Commit

Permalink
chore: playwright config in esm
Browse files Browse the repository at this point in the history
  • Loading branch information
3cp committed Jul 10, 2024
1 parent 38bbfa0 commit efe770c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
5 changes: 0 additions & 5 deletions app-min/e2e__if_playwright/app.spec.ext__if_not_plugin
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
// @if typescript
import { test, expect } from '@playwright/test';
// @endif
// @if babel
const { test, expect } = require('@playwright/test');
// @endif

test.beforeEach(async ({ page }) => {
await page.goto('http://localhost:9000');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
// @if typescript
import type { PlaywrightTestConfig } from '@playwright/test';
import { devices } from '@playwright/test';
// @endif
// @if babel
// @ts-check
const { devices } = require('@playwright/test');
// @endif
import { defineConfig, devices } from '@playwright/test';

/**
* Read environment variables from file.
Expand All @@ -16,7 +9,7 @@ const { devices } = require('@playwright/test');
/**
* See https://playwright.dev/docs/test-configuration.
*/
const config/* @if typescript */: PlaywrightTestConfig/* @endif */ = {
export default defineConfig({
testDir: './e2e',
/* Maximum time one test can run for. */
timeout: 30 * 1000,
Expand Down Expand Up @@ -108,11 +101,4 @@ const config/* @if typescript */: PlaywrightTestConfig/* @endif */ = {
command: 'npm start',
port: 9000,
},
};

// @if typescript
export default config;
// @endif
// @if babel
module.exports = config;
// @endif
});

0 comments on commit efe770c

Please sign in to comment.