Skip to content

Commit ac421b0

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 d5bb4a6 commit ac421b0

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
@@ -165,7 +165,11 @@ export async function parseProject (opts: ProjectParseOpts): Promise<Project> {
165165
ignoreWorkspaces: !enableWorkspaces,
166166
})
167167

168-
checklyConfigConstructs?.forEach(
168+
const filteredConstructs = currentCommand === 'pw-test'
169+
? checklyConfigConstructs?.filter(c => !(c instanceof PlaywrightCheck))
170+
: checklyConfigConstructs
171+
172+
filteredConstructs?.forEach(
169173
construct => project.addResource(construct.type, construct.logicalId, construct),
170174
)
171175
Session.project = project
@@ -186,7 +190,9 @@ export async function parseProject (opts: ProjectParseOpts): Promise<Project> {
186190
// TODO: Do we really need all of the ** globs, or could we just put node_modules?
187191
const ignoreDirectories = ['**/node_modules/**', '**/.git/**', ...ignoreDirectoriesMatch]
188192

189-
await loadAllCheckFiles(directory, checkMatch, ignoreDirectories)
193+
if (currentCommand !== 'pw-test') {
194+
await loadAllCheckFiles(directory, checkMatch, ignoreDirectories)
195+
}
190196

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

0 commit comments

Comments
 (0)