Skip to content

Commit 466f8ed

Browse files
miliberlinclaude
andcommitted
fix: skip PlaywrightCheck constructs and check files during pw-test [RED-155]
When pw-test runs, PlaywrightCheck constructs defined in .check.ts files should not be loaded — they interfere with the ad-hoc Playwright test run by adding a second check and clobbering dependency resolution. Two changes in parseProject() when currentCommand === 'pw-test': 1. Filter PlaywrightCheck instances from checklyConfigConstructs 2. Skip loadAllCheckFiles() entirely Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ed86e4a commit 466f8ed

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/cli/src/services/project-parser.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@ export async function parseProject (opts: ProjectParseOpts): Promise<Project> {
7474
project.allowTestOnly(true)
7575
}
7676

77-
checklyConfigConstructs?.forEach(
77+
const filteredConstructs = currentCommand === 'pw-test'
78+
? checklyConfigConstructs?.filter(c => !(c instanceof PlaywrightCheck))
79+
: checklyConfigConstructs
80+
81+
filteredConstructs?.forEach(
7882
construct => project.addResource(construct.type, construct.logicalId, construct),
7983
)
8084
Session.project = project
@@ -92,7 +96,9 @@ export async function parseProject (opts: ProjectParseOpts): Promise<Project> {
9296
// TODO: Do we really need all of the ** globs, or could we just put node_modules?
9397
const ignoreDirectories = ['**/node_modules/**', '**/.git/**', ...ignoreDirectoriesMatch]
9498

95-
await loadAllCheckFiles(directory, checkMatch, ignoreDirectories)
99+
if (currentCommand !== 'pw-test') {
100+
await loadAllCheckFiles(directory, checkMatch, ignoreDirectories)
101+
}
96102

97103
// Load sequentially because otherwise Session.checkFileAbsolutePath and
98104
// Session.checkFilePath are going to be subject to race conditions.

0 commit comments

Comments
 (0)