Skip to content

🐛 BUG: Issue with testing workers using SELF #7795

@valeriydev

Description

@valeriydev

Which Cloudflare product(s) does this pertain to?

Workers Runtime

What versions are you using?

^3.101.0 wrangler

What operating system and version are you using?

Windows 11

Please provide a link to a minimal reproduction

No response

Describe the Bug

Hi everyone.
Trying to write some cloudflare unit tests for my workers using @cloudflare/vitest-pool-workers, when importing SELF from "cloudflare:test" and starting my test, them failed with strange error: Error: Failed to load url cloudflare:test (resolved id: cloudflare:test)

Instead of "url" in self.fetch(...) i use my server url, which i can access

;/ Any ideas???

Image

Image

devdeps:
"@cloudflare/vitest-pool-workers": "^0.6.0",
"@cloudflare/workers-types": "^4.20230321.0",
deps:
"wrangler": "^3.101.0"

Please provide any relevant error logs

Error: Failed to load url cloudflare:test (resolved id: cloudflare:test)

Does the file exist?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething that isn't workingvitestRelating to the Workers Vitest integration

    Type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions