generated from MetaMask/metamask-module-template
-
Notifications
You must be signed in to change notification settings - Fork 7
Closed
Labels
choreNot a feature, not documentation, but something we still have to do.Not a feature, not documentation, but something we still have to do.
Description
We are eventually going to want to test in the browser, under ses, in an environment that's as close to what we'd expect in production as possible. vitest allows you to do this using its browser mode. I played around with doing this in #11, but punted until the future because I didn't want to rewrite existing JSDOM tests. Here's what I found:
- For unit tests, the coverage provider has to be
istanbul- We may as well switch to
istanbuleverywhere if possible.
- We may as well switch to
- The following
vitestconfig appeared to work:
const defaultConfig = getDefaultConfig();
delete defaultConfig.test?.environment;
export default mergeConfig(
defaultConfig,
defineConfig({
test: {
setupFiles: '../shims/dist/endoify.mjs',
browser: {
provider: 'playwright',
name: 'chromium',
enabled: true,
headless: true,
}
},
}),
);Metadata
Metadata
Assignees
Labels
choreNot a feature, not documentation, but something we still have to do.Not a feature, not documentation, but something we still have to do.