From 3c3b8ce677e304d57cb13273babe0f2226b53e24 Mon Sep 17 00:00:00 2001 From: Nico Jansen Date: Mon, 27 Nov 2023 09:09:23 +0100 Subject: [PATCH] fix(browser): allow for `pretty-format` as a sibling dependency (#4590) --- packages/browser/src/node/esmInjector.ts | 2 +- packages/browser/src/node/index.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/browser/src/node/esmInjector.ts b/packages/browser/src/node/esmInjector.ts index 4c1401c49c7b..a1e9fa7c67fc 100644 --- a/packages/browser/src/node/esmInjector.ts +++ b/packages/browser/src/node/esmInjector.ts @@ -41,7 +41,7 @@ export function injectVitestModule(code: string, id: string, parse: PluginContex let hasInjected = false - // this will tranfrom import statements into dynamic ones, if there are imports + // this will transform import statements into dynamic ones, if there are imports // it will keep the import as is, if we don't need to mock anything // in browser environment it will wrap the module value with "vitest_wrap_module" function // that returns a proxy to the module so that named exports can be mocked diff --git a/packages/browser/src/node/index.ts b/packages/browser/src/node/index.ts index 448665992c5d..efbffad20262 100644 --- a/packages/browser/src/node/index.ts +++ b/packages/browser/src/node/index.ts @@ -63,6 +63,7 @@ export default (project: WorkspaceProject, base = '/'): Plugin[] => { ], include: [ 'vitest > @vitest/utils > pretty-format', + 'vitest > @vitest/snapshot > pretty-format', 'vitest > diff-sequences', 'vitest > loupe', 'vitest > pretty-format',