Skip to content

Commit

Permalink
implement suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
DerTimonius committed Jul 8, 2024
1 parent cbcdb92 commit bf7e331
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ export class Generator {
gitIgnore = fs.readFileSync(gitIgnorePath, 'utf-8').trimEnd() + '\n';
const valuesToAdd = {
'node_modules/': /^node_modules\/?/m,
'/test-results/': /^test-results\/?$/m,
'/test-results/': /^\/?test-results\/?$/m,
'/playwright-report/': /^\/playwright-report\/?$/m,
'/blob-report/': /^\/blob-report\/?$/m,
'/playwright/.cache/': /^\/playwright\/\.cache\/?$/m
Expand Down
4 changes: 2 additions & 2 deletions tests/integration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ test('should generate a project in the current directory', async ({ run, dir, pa
expect(playwrightConfigContent).toContain('tests');
expect(fs.existsSync(path.join(dir, '.github/workflows/playwright.yml'))).toBeTruthy();
expect(fs.existsSync(path.join(dir, '.gitignore'))).toBeTruthy();
expect(fs.readFileSync(path.join(dir, '.gitignore'), { encoding: 'utf8' })).toMatch(validGitignore);
expect(fs.readFileSync(path.join(dir, '.gitignore'), { encoding: 'utf8' }).trim()).toBe(validGitignore);
if (packageManager === 'npm') {
expect(stdout).toContain('Initializing NPM project (npm init -y)…');
expect(stdout).toContain('Installing Playwright Test (npm install --save-dev @playwright/test)…');
Expand Down Expand Up @@ -115,7 +115,7 @@ test('should not duplicate gitignore entries', async ({ run, dir }) => {
fs.writeFileSync(path.join(dir, '.gitignore'), validGitignore);

await run([], { installGitHubActions: false, testDir: 'tests', language: 'TypeScript', installPlaywrightDependencies: false, installPlaywrightBrowsers: false });
expect(fs.readFileSync(path.join(dir, '.gitignore'), { encoding: 'utf8' })).toMatch(validGitignore);
expect(fs.readFileSync(path.join(dir, '.gitignore'), { encoding: 'utf8' }).trim()).toBe(validGitignore);
})

test('should install with "npm ci" in GHA when using npm with package-lock enabled', async ({ dir, run, packageManager }) => {
Expand Down

0 comments on commit bf7e331

Please sign in to comment.