MCPcopy Create free account
hub / github.com/massCodeIO/massCode / loadSpaceDefinitions

Function loadSpaceDefinitions

src/renderer/__tests__/spaceDefinitions.test.ts:3–42  ·  view source on GitHub ↗
(savedNotesRoute?: string)

Source from the content-addressed store, hash-verified

1import { beforeEach, describe, expect, it, vi } from 'vitest'
2
3async function loadSpaceDefinitions(savedNotesRoute?: string) {
4 vi.resetModules()
5
6 vi.doMock('@/electron', () => ({
7 i18n: {
8 t: (value: string) => value,
9 },
10 store: {
11 app: {
12 get: vi.fn((key: string) => {
13 if (key === 'notes.route') {
14 return savedNotesRoute
15 }
16
17 return undefined
18 }),
19 },
20 },
21 }))
22
23 vi.doMock('@/router', () => ({
24 RouterName: {
25 main: 'main',
26 notesSpace: 'notes-space',
27 notesDashboard: 'notes-space/dashboard',
28 notesGraph: 'notes-space/graph',
29 mathNotebook: 'math-notebook',
30 devtools: 'devtools',
31 },
32 router: {
33 currentRoute: {
34 value: {
35 name: null,
36 },
37 },
38 },
39 }))
40
41 return import('../spaceDefinitions')
42}
43
44beforeEach(() => {
45 vi.clearAllMocks()

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected