Skip to content
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
12 changes: 8 additions & 4 deletions .github/workflows/ci.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [18.x, 20.x, 22.x, 24.x]
node-version: [20.x, 22.x, 24.x, 26.x]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
Expand All@@ -26,6 +26,10 @@ jobs:
- run: npm run build
- run: npx tsc --noEmit
- run: npx playwright test --grep-invert yarn-berry
- run: corepack enable
- run: corepack prepare yarn@4 --activate
- run: npx playwright test --grep yarn-berry
# Note: `yarn init` through corepack pins a stale yarn version into the generated project,
# so install yarn berry directly instead.
# Yarn PnP is broken on Node 22: its loader passes the CommonJS source to Node, and require.cache is undefined.
- if: matrix.node-version != '22.x'
run: npm i -g --force @yarnpkg/cli-dist@4
- if: matrix.node-version != '22.x'
run: npx playwright test --grep yarn-berry
3 changes: 2 additions & 1 deletion .gitignore
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
node_modules/
lib/
test-results/
test-results/
.vscode
129 changes: 53 additions & 76 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,7 +11,7 @@
"name": "Microsoft Corporation"
},
"engines": {
"node": ">=18"
"node": ">=20"
},
"main": "index.js",
"bin": {
Expand All@@ -26,14 +26,14 @@
"prepublish": "npm run build"
},
"devDependencies": {
"@playwright/test": "^1.59.0-alpha-1769819922000",
"@playwright/test": "1.63.0-alpha-2026-08-17",
"@types/ini": "^4.1.1",
"@types/node": "^18.19.33",
"@types/node": "^20.19.43",
"ansi-colors": "^4.1.1",
"commander": "^14.0.1",
"enquirer": "^2.3.6",
"esbuild": "^0.25.0",
"ini": "^4.1.3",
"typescript": "^5.4.5"
"typescript": "^6.0.3"
}
}
3 changes: 3 additions & 0 deletions playwright.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,6 +21,7 @@ import os from 'node:os';

export default defineConfig<TestFixtures>({
timeout: 120 * 1000,
fullyParallel: true,
testDir: './tests',
reporter: 'list',
outputDir: fs.mkdtempSync(path.join(os.tmpdir(), 'create-playwright-test-')), // place test dir outside to prevent influece from `yarn.lock` or `package.json` in repo
Expand All@@ -33,6 +34,8 @@ export default defineConfig<TestFixtures>({
},
{
name: 'yarn-classic',
// Yarn classic does not support concurrent access to its global cache.
workers: 1,
use: {
packageManager: 'yarn-classic'
}
Expand Down
2 changes: 1 addition & 1 deletion tests/component-testing.spec.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,7 +17,7 @@ import { test, expect, assertLockFilesExist, packageManagerToNpxCommand } from '
import path from 'path';
import fs from 'fs';

test('should be able to generate and run a CT React project', async ({ run, dir, exec, packageManager }) => {
test('should be able to generate and run a CT React project', { lock: 'apt-get' }, async ({ run, dir, exec, packageManager }) => {
test.skip(packageManager === 'yarn-classic' || packageManager === 'yarn-berry');
test.slow();
await run(['--ct'], { installGitHubActions: true, testDir: 'tests', language: 'TypeScript', installPlaywrightDependencies: false, installPlaywrightBrowsers: true, framework: 'react' });
Expand Down
4 changes: 2 additions & 2 deletions tests/integration.spec.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -77,7 +77,7 @@ test('should generate a project with JavaScript and without GHA', async ({ run,
expect(fs.existsSync(path.join(dir, '.github/workflows/playwright.yml'))).toBeFalsy();
});

test('should generate be able to run TS examples successfully', async ({ run, dir, exec, packageManager }) => {
test('should generate be able to run TS examples successfully', { lock: 'apt-get' }, async ({ run, dir, exec, packageManager }) => {
test.slow();
await run([], { installGitHubActions: false, testDir: 'tests', language: 'TypeScript', installPlaywrightDependencies: false, installPlaywrightBrowsers: true });
expect(fs.existsSync(path.join(dir, 'tsconfig.json'))).toBeTruthy();
Expand All@@ -89,7 +89,7 @@ test('should generate be able to run TS examples successfully', async ({ run, di
await exec(packageManagerToNpxCommand(packageManager), ['playwright', 'test']);
});

test('should generate be able to run JS examples successfully', async ({ run, dir, exec, packageManager }) => {
test('should generate be able to run JS examples successfully', { lock: 'apt-get' }, async ({ run, dir, exec, packageManager }) => {
test.slow();
await run([], { installGitHubActions: false, testDir: 'tests', language: 'JavaScript', installPlaywrightDependencies: false, installPlaywrightBrowsers: true });
expect(fs.existsSync(path.join(dir, 'tests/example.spec.js'))).toBeTruthy();
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
{
"compilerOptions": {
"target": "ES2019",
"types": ["node"],
"module": "commonjs",
"esModuleInterop": true,
"strict": true,
Expand All@@ -13,6 +14,5 @@
"noUncheckedIndexedAccess": true
},
"compileOnSave": true,
"include": ["src", "tests", "assets"],
"exclude": ["assets/playwright-ct.config.ts", "assets/playwright-ct.config.js"]
"exclude": ["node_modules", "lib", "test-results", "assets/playwright-ct.config.ts", "assets/playwright-ct.config.js"]
}
Loading