Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add link to snapshot testing in file snapshots #2864

Closed
4 tasks done
trivikr opened this issue Feb 13, 2023 · 0 comments · Fixed by #2867
Closed
4 tasks done

Add link to snapshot testing in file snapshots #2864

trivikr opened this issue Feb 13, 2023 · 0 comments · Fixed by #2867
Labels
enhancement New feature or request pr welcome

Comments

@trivikr
Copy link
Contributor

trivikr commented Feb 13, 2023

Clear and concise description of the problem

This suggestion comes from the helpful link to snapshot testing which Jest adds.

Example code:

test("toMatchSnapshot", () => {
  expect("foobar".toUpperCase()).toMatchSnapshot();
});

The snapshot on running jest

// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`toMatchSnapshot 1`] = `"FOOBAR"`;

The link https://goo.gl/fbAQLP in the top level comment goes to https://jestjs.io/docs/snapshot-testing

No such link is present in Vitest snapshots

// Vitest Snapshot v1

exports[`toMatchSnapshot 1`] = `"FOOBAR"`;

Suggested solution

Add link to snapshot testing in the top-level comment of Vitest snapshots

// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`toMatchSnapshot 1`] = `"FOOBAR"`;

Alternative

No response

Additional context

No response

Validations

@sheremet-va sheremet-va added enhancement New feature or request pr welcome labels Feb 13, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jun 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request pr welcome
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants