MCPcopy
hub / github.com/smapiot/piral / createMockContainer

Function createMockContainer

src/framework/piral-core/src/actions/define.test.ts:5–15  ·  view source on GitHub ↗
(initialState = {})

Source from the content-addressed store, hash-verified

3import { defineAction, defineActions } from './define';
4
5function createMockContainer(initialState = {}) {
6 const state = create(() => initialState);
7 return {
8 context: {
9 on: vitest.fn(),
10 off: vitest.fn(),
11 emit: vitest.fn(),
12 state,
13 } as any,
14 };
15}
16
17describe('Piral-Core define actions', () => {
18 it('defineAction adds a single action with bind', () => {

Callers 1

define.test.tsFile · 0.70

Calls 1

createFunction · 0.50

Tested by

no test coverage detected