Skip to content

fix: use dirname() for resolveSnapshotPath to avoid EISDIR conflict#1124

Merged
wswebcreation merged 1 commit intomainfrom
ws/fix-984-resolveSnapshotPath
Feb 24, 2026
Merged

fix: use dirname() for resolveSnapshotPath to avoid EISDIR conflict#1124
wswebcreation merged 1 commit intomainfrom
ws/fix-984-resolveSnapshotPath

Conversation

@wswebcreation
Copy link
Member

@wswebcreation wswebcreation commented Feb 24, 2026

Summary

  • When resolveSnapshotPath is configured, the visual-service used the returned file path directly as a baseline directory, creating it with mkdirSync. This conflicted with expect-webdriverio's SnapshotService, which tries to read the same path as a .snap file, resulting in EISDIR: illegal operation on a directory, read.
  • Wrapping the resolveSnapshotPath result with dirname() extracts the parent directory so the two consumers no longer collide.

Fixes #984

…984)

The visual-service was using the resolveSnapshotPath return value directly
as a baseline directory, but this path is also read as a file by
expect-webdriverio's SnapshotService. Wrapping with dirname() extracts
the parent directory so the two consumers no longer collide.

Co-authored-by: Cursor <cursoragent@cursor.com>
@changeset-bot
Copy link

changeset-bot bot commented Feb 24, 2026

🦋 Changeset detected

Latest commit: 80fc686

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@wdio/visual-service Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@wswebcreation wswebcreation merged commit ed0bea6 into main Feb 24, 2026
14 checks passed
@wswebcreation wswebcreation deleted the ws/fix-984-resolveSnapshotPath branch February 24, 2026 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

resolveSnapshotPath Logs an Error, But Tests Continue

1 participant