cloudflare / workers-sdk

⛅️ Home to Wrangler, the CLI for Cloudflare Workers®
https://developers.cloudflare.com/workers/
Apache License 2.0
2.74k stars 726 forks source link

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

Open NonSpicyBurrito opened 1 week ago

NonSpicyBurrito commented 1 week ago

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

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:
```diff
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();
});

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

No response