From f1220fa52cd01404ba6f8c13867320279018607d Mon Sep 17 00:00:00 2001 From: Ariel Caplan Date: Tue, 1 Oct 2024 23:15:41 +0300 Subject: [PATCH] Set theme store in test when calling ensureThemeStore --- packages/theme/src/cli/services/pull.test.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/theme/src/cli/services/pull.test.ts b/packages/theme/src/cli/services/pull.test.ts index de0d7e84f7..cac0543c73 100644 --- a/packages/theme/src/cli/services/pull.test.ts +++ b/packages/theme/src/cli/services/pull.test.ts @@ -1,4 +1,5 @@ import {isEmptyDir, pull, PullFlags} from './pull.js' +import {setThemeStore} from './local-storage.js' import {findOrSelectTheme} from '../utilities/theme-selector.js' import {ensureThemeStore} from '../utilities/theme-store.js' import {DevelopmentThemeManager} from '../utilities/development-theme-manager.js' @@ -39,7 +40,11 @@ describe('pull', () => { const fetchDevelopmentThemeSpy = vi.spyOn(DevelopmentThemeManager.prototype, 'fetch') beforeEach(() => { - vi.mocked(ensureThemeStore).mockReturnValue('example.myshopify.com') + vi.mocked(ensureThemeStore).mockImplementation(() => { + const themeStore = 'example.myshopify.com' + setThemeStore(themeStore) + return themeStore + }) vi.mocked(ensureAuthenticatedThemes).mockResolvedValue(adminSession) vi.mocked(mountThemeFileSystem).mockReturnValue(localThemeFileSystem) vi.mocked(fetchChecksums).mockResolvedValue([])