-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
69 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,27 @@ | ||
// mock electron-store | ||
'use strict' | ||
import { DEFAULTS_V12 } from '../app-shell-odd/src/config/migrate' | ||
import { vi } from 'vitest' | ||
import { DEFAULTS_V12, migrate } from '../app-shell-odd/src/config/migrate' | ||
|
||
const Store = function () { | ||
// this.get = () => ({ | ||
// DEFAULTS_V12, | ||
// }) | ||
this.store = () => ({ | ||
DEFAULTS_V12, | ||
// will by default mock the config dir. if you need other behaavior you can | ||
// override this mock (see app-shell/src/__tests__/discovery.test.ts for an example) | ||
const Store = vi.fn(function () { | ||
this.store = vi.fn(() => { | ||
return {} | ||
}) | ||
this.get = property => { | ||
return DEFAULTS_V12[property] | ||
} | ||
} | ||
this.get = vi.fn(property => { | ||
return {} | ||
}) | ||
this.onDidChange = vi.fn() | ||
}) | ||
|
||
// eslint-disable-next-line import/no-default-export | ||
export default Store | ||
|
||
// const Store = vi.fn(function () { | ||
// this.store = vi.fn(() => migrate(DEFAULTS_V12)) | ||
// this.get = vi.fn(property => { | ||
// return this.store()[property] | ||
// }) | ||
// this.onDidChange = vi.fn() | ||
// }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters