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

🐛 BUG: Vitest inline snapshot does not get updated #7288

Open
NonSpicyBurrito opened this issue Nov 18, 2024 · 0 comments
Open

🐛 BUG: Vitest inline snapshot does not get updated #7288

NonSpicyBurrito opened this issue Nov 18, 2024 · 0 comments
Labels
bug Something that isn't working

Comments

@NonSpicyBurrito
Copy link

Which Cloudflare product(s) does this pertain to?

Workers Vitest Integration

What version(s) of the tool(s) are you using?

3.60.3 [Wrangler]

What version of Node are you using?

20.18.0

What operating system and version are you using?

Windows 10

Describe the Bug

Observed behavior

Inline snapshot does not get updated.

Expected behavior

Inline snapshot gets updated.

Steps to reproduce

  • npm create cloudflare@latest, select hello world example with TS.
  • Delete some code in test/index.spect.ts so that it's left with:
import { SELF } from 'cloudflare:test';
import { it, expect } from 'vitest';

it('responds with Hello World! (integration style)', async () => {
    const response = await SELF.fetch('https://example.com');
    expect(await response.text()).toMatchInlineSnapshot();
});
  • npm run test, observe that inline snapshot does not get updated.
  • Add two lines of useless comments such as:
import { SELF } from 'cloudflare:test';
import { it, expect } from 'vitest';

+ // hello
+ // world
it('responds with Hello World! (integration style)', async () => {
    const response = await SELF.fetch('https://example.com');
    expect(await response.text()).toMatchInlineSnapshot();
});
  • npm run test, observe that inline snapshot does get updated.

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

No response

@NonSpicyBurrito NonSpicyBurrito added the bug Something that isn't working label Nov 18, 2024
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working
Projects
Status: Untriaged
Development

No branches or pull requests

1 participant