MCPcopy
hub / github.com/scalar/scalar / createStore

Function createStore

packages/blocks/src/code-example/mount.test.ts:10–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8
9/** Spins up a store with a single POST /hello operation. */
10const createStore = async () => {
11 const store = createWorkspaceStore()
12
13 await store.addDocument({
14 name: 'default',
15 document: {
16 openapi: '3.1.0',
17 info: { title: 'Petstore', version: '1.0.0' },
18 paths: {
19 '/hello': {
20 post: {
21 summary: 'Hello World',
22 requestBody: {
23 content: {
24 'application/json': {
25 schema: { type: 'object', properties: { name: { type: 'string' } } },
26 },
27 },
28 },
29 },
30 },
31 },
32 },
33 })
34
35 return store
36}
37
38describe('mount', () => {
39 const mounted: Array<{ destroy: () => void }> = []

Callers 1

mount.test.tsFile · 0.70

Calls 1

createWorkspaceStoreFunction · 0.90

Tested by

no test coverage detected