mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-10 15:38:00 -05:00
* feat(executor): split executor into specialized components * fix(executor): if there is a dependency on a block that is not along the selected path, ignore it; if we are at max iterations for a loop, stop * feat(exector): cleanup inline comments in executor * fix(executor): fix issue in removeDownstreamBlocks when we are breaking out of a loop to prevent infinite recursion * feat(executor/tests): setup initial testing directory * feat(executor): make the path selection for routing/conditional blocks independent of context, instead of deactivating paths we just activate others
55 lines
1.1 KiB
JavaScript
55 lines
1.1 KiB
JavaScript
require('@testing-library/jest-dom')
|
|
|
|
// Mock global fetch
|
|
global.fetch = jest.fn(() =>
|
|
Promise.resolve({
|
|
ok: true,
|
|
json: () => Promise.resolve({}),
|
|
})
|
|
)
|
|
|
|
// Mock stores
|
|
jest.mock('@/stores/console/store', () => ({
|
|
useConsoleStore: {
|
|
getState: jest.fn().mockReturnValue({
|
|
addConsole: jest.fn(),
|
|
}),
|
|
},
|
|
}))
|
|
|
|
jest.mock('@/stores/execution/store', () => ({
|
|
useExecutionStore: {
|
|
getState: jest.fn().mockReturnValue({
|
|
setIsExecuting: jest.fn(),
|
|
reset: jest.fn(),
|
|
setActiveBlocks: jest.fn(),
|
|
}),
|
|
},
|
|
}))
|
|
|
|
// Reset mocks before each test
|
|
beforeEach(() => {
|
|
jest.clearAllMocks()
|
|
})
|
|
|
|
// Silence specific console errors during tests
|
|
const originalConsoleError = console.error
|
|
console.error = (...args) => {
|
|
// Filter out expected errors from test output
|
|
if (args[0] === 'Workflow execution failed:' && args[1]?.message === 'Test error') {
|
|
return
|
|
}
|
|
originalConsoleError(...args)
|
|
}
|
|
|
|
// Global setup
|
|
beforeAll(() => {
|
|
// Add any global setup here
|
|
})
|
|
|
|
// Global teardown
|
|
afterAll(() => {
|
|
// Restore console.error
|
|
console.error = originalConsoleError
|
|
})
|