workers-sdk icon indicating copy to clipboard operation
workers-sdk copied to clipboard

🐛 BUG: Vitest: runInDurableObject() fails if package.json contains a namespace (e.g. @repo/my-worker)

Open jahands opened this issue 1 year ago • 0 comments

Which Cloudflare product(s) does this pertain to?

Workers Vitest Integration

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

[email protected], @cloudflare/[email protected]

What version of Node are you using?

22.9.0

What operating system and version are you using?

Mac Sonoma 14.6.1

Describe the Bug

Observed behavior

Tests fail when using runInDurableObject() when package.json contains a namespace in the name field (e.g. @repo/worker-a instead of worker-a.)

Note: adding a namespace like @repo/ to packages is useful in monorepos for tools like syncpack where I want to treat all @repo/ packages as local.

Expected behavior

Tests pass

Steps to reproduce

git clone https://github.com/jahands/cf-vitest-pkg-name-error.git
cd cf-vitest-pkg-name-error
pnpm install
pnpm test

Please provide a link to a minimal reproduction

https://github.com/jahands/cf-vitest-pkg-name-error

Please provide any relevant error logs

See repo README

jahands avatar Oct 12 '24 10:10 jahands