Skip to content

🐛 BUG: jest-image-snapshot is not work with the new vitest integration #5605

@ducan-ne

Description

@ducan-ne

Which Cloudflare product(s) does this pertain to?

Workers Vitest Integration

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

"@cloudflare/vitest-pool-workers": "^0.1.19", "wrangler": "3.37.0"

What version of Node are you using?

20.12.1

What operating system and version are you using?

Mac Sonoma 14

Describe the Bug

Observed behavior

I want to test if my image response from worker is valid or not but couldn't make it work with jest-image-snapshot, AFAIK it's the only solution for image snapshot https://vitest.dev/guide/snapshot#image-snapshots

The error I got

Error: No such module "node:child_process".

Expected behavior

It should works like the default setting of vitest

Steps to reproduce

Please provide the following:

  • A simple worker return image
  • install jest-image-snapshot
  • extend the matcher with expect.extend({ toMatchImageSnapshot })
  • Run test

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    vitestRelating to the Workers Vitest integration

    Type

    No fields configured for Bug.

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions