Skip to content

chore: refactor toMatchSnapshot once again#12313

Merged
aslushnikov merged 1 commit into
microsoft:mainfrom
aslushnikov:to-match-screenshot-refactor
Feb 23, 2022
Merged

chore: refactor toMatchSnapshot once again#12313
aslushnikov merged 1 commit into
microsoft:mainfrom
aslushnikov:to-match-screenshot-refactor

Conversation

@aslushnikov
Copy link
Copy Markdown
Contributor

Keep massaging code in preparation for toHaveScreenshot.

References #9938

expect(fs.existsSync(actualSnapshotArtifactPath)).toBe(false);
});

test('should pass on different snapshots with negate matcher', async ({ runInlineTest }) => {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dupes functionality of a previous test

@aslushnikov
Copy link
Copy Markdown
Contributor Author

VC review comments:

  • move parseOptions to helper constructor
  • remove hasSnapshotFile
  • rename methods to:
    • handleMissingNegated
    • handleDifferentNegated
    • handleMatchingNegated
    • handleMissing
    • handleDifferent
    • handleMatching

Keep massaging code in preparation for `toHaveScreenshot`.

References microsoft#9938
@aslushnikov aslushnikov force-pushed the to-match-screenshot-refactor branch from 50a1850 to 80a8074 Compare February 23, 2022 21:15
@aslushnikov aslushnikov merged commit 5879c7f into microsoft:main Feb 23, 2022
@aslushnikov aslushnikov deleted the to-match-screenshot-refactor branch February 23, 2022 21:17
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.

2 participants