Skip to content

How to import an SDK library inside tests that are executed in Browser mode #7563

Answered by hi-ogawa
dompuiu asked this question in Q&A
Discussion options

You must be logged in to vote

I think you can pass an absolute path based on config.root

// helper.js
import { server } from "@vitest/browser/context";
await server.commands.readFile(server.config.root + "/dist/alloy.js");

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@dompuiu
Comment options

Answer selected by dompuiu
Comment options

You must be logged in to vote
1 reply
@hi-ogawa
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants