Skip to content

Commit

Permalink
test: update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Dec 1, 2023
1 parent f8ef0d6 commit 6b029e9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/unit/mock-transform.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@ describe('mocking', () => {
`)).toMatchInlineSnapshot(`
"import {vi} from "vitest";
vi.hoisted(() => {
if(!global.__NUXT_VITEST_MOCKS){
if(!globalThis.__NUXT_VITEST_MOCKS){
vi.stubGlobal("__NUXT_VITEST_MOCKS", {})
}
});
vi.mock("bob", async (importOriginal) => {
const mocks = global.__NUXT_VITEST_MOCKS
if (!mocks["bob"]) { mocks["bob"] = { ...await importOriginal("bob") } }
const mocks = globalThis.__NUXT_VITEST_MOCKS
if (!mocks["bob"]) {
mocks["bob"] = { ...await importOriginal("bob") }
}
mocks["bob"]["useSomeExport"] = await (() => {
return () => 'mocked'
})();
Expand Down Expand Up @@ -100,7 +102,7 @@ describe('mocking', () => {
`)).toMatchInlineSnapshot(`
"import {vi} from "vitest";
vi.hoisted(() => {
if(!global.__NUXT_VITEST_MOCKS){
if(!globalThis.__NUXT_VITEST_MOCKS){
vi.stubGlobal("__NUXT_VITEST_MOCKS", {})
}
});
Expand Down

0 comments on commit 6b029e9

Please sign in to comment.