Skip to content

Commit

Permalink
chore: use import instead of require
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt committed Oct 23, 2024
1 parent 4cf6c05 commit ab66e41
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion assets/demo-todo-app.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-check
const { test, expect } = require('@playwright/test');
import { test, expect } from '@playwright/test';

test.beforeEach(async ({ page }) => {
await page.goto('https://demo.playwright.dev/todomvc');
Expand Down
2 changes: 1 addition & 1 deletion assets/example.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-check
const { test, expect } = require('@playwright/test');
import { test, expect } from '@playwright/test';

test('has title', async ({ page }) => {
await page.goto('https://playwright.dev/');
Expand Down
2 changes: 1 addition & 1 deletion assets/playwright-ct.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-check
const { defineConfig, devices } = require('{{ctPackageName}}');
import { defineConfig, devices } from '{{ctPackageName}}';

/**
* @see https://playwright.dev/docs/test-configuration
Expand Down
8 changes: 5 additions & 3 deletions assets/playwright.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
// @ts-check
const { defineConfig, devices } = require('@playwright/test');
import { defineConfig, devices } from '@playwright/test';

/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
// require('dotenv').config({ path: path.resolve(__dirname, '.env') });
// import dotenv from 'dotenv';
// import path from 'path';
// dotenv.config({ path: path.resolve(__dirname, '.env') });

/**
* @see https://playwright.dev/docs/test-configuration
*/
module.exports = defineConfig({
export default defineConfig({
testDir: './{{testDir}}',
/* Run tests in files in parallel */
fullyParallel: true,
Expand Down

0 comments on commit ab66e41

Please sign in to comment.