Is mock mode to fix errors when cap end or ids dont exist. (#1913)

* add is_mock

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* js side

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* is mock mode

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix cargo tests

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2024-03-26 19:32:31 -07:00
committed by GitHub
parent dce5833d79
commit 86de039dc4
18 changed files with 71 additions and 177 deletions

View File

@ -127,13 +127,15 @@ export interface ProgramMemory {
export const executor = async (
node: Program,
programMemory: ProgramMemory = { root: {}, return: null },
engineCommandManager: EngineCommandManager
engineCommandManager: EngineCommandManager,
isMock: boolean = false
): Promise<ProgramMemory> => {
engineCommandManager.startNewSession()
const _programMemory = await _executor(
node,
programMemory,
engineCommandManager
engineCommandManager,
isMock
)
await engineCommandManager.waitForAllCommands()
@ -148,7 +150,8 @@ const getSettingsState = import('components/SettingsAuthProvider').then(
export const _executor = async (
node: Program,
programMemory: ProgramMemory = { root: {}, return: null },
engineCommandManager: EngineCommandManager
engineCommandManager: EngineCommandManager,
isMock: boolean
): Promise<ProgramMemory> => {
try {
const baseUnit = (await getSettingsState)()?.baseUnit || 'mm'
@ -157,7 +160,8 @@ export const _executor = async (
JSON.stringify(programMemory),
baseUnit,
engineCommandManager,
fileSystemManager
fileSystemManager,
isMock
)
return memory
} catch (e: any) {