Skip to content

iterate-com/cf-vitest-repro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple repro of vitest and workers.

In src/workers we have cloudflare specific code with the corresponding tests.

We have a vitest workspace setup to target only this directory.

In src/lib we have Node.js code. The vitest workspace node is setup to target this, but not the workers directory.

Run pnpm vitest - see error:

FAIL   workers  src/workers/index.test.ts [ src/workers/index.test.ts ]
SyntaxError: The requested module 'node:fs' does not provide an export named 'ReadStream'

Remove the openai usage in src/workers/index.ts. Then re-run the tests:

[vpw:inf] Starting isolated runtimes for 0...
 ✓  node  src/lib/greet.test.ts (1 test) 3ms
 ✓  workers  src/workers/index.test.ts (1 test) 6ms

It works!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published