Skip to content

Commit

Permalink
Set theme store in test when calling ensureThemeStore
Browse files Browse the repository at this point in the history
  • Loading branch information
amcaplan committed Oct 1, 2024
1 parent 11600b5 commit f1220fa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/theme/src/cli/services/pull.test.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -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([])
Expand Down

0 comments on commit f1220fa

Please sign in to comment.