MCPcopy Index your code
hub / github.com/simstudioai/sim / createSession

Function createSession

packages/testing/src/factories/permission.factory.ts:211–221  ·  view source on GitHub ↗
(options: SessionFactoryOptions = {})

Source from the content-addressed store, hash-verified

209 * Creates a mock session object.
210 */
211export function createSession(options: SessionFactoryOptions = {}): MockSession {
212 const userId = options.userId ?? `user-${shortId(6)}`
213 return {
214 user: {
215 id: userId,
216 email: options.email ?? `${userId}@test.com`,
217 name: options.name,
218 },
219 expiresAt: options.expiresAt ?? new Date(Date.now() + 24 * 60 * 60 * 1000),
220 }
221}
222
223/**
224 * Workflow access context for testing.

Callers 5

utils.test.tsFile · 0.90
route.test.tsFile · 0.90
route.test.tsFile · 0.90
route.test.tsFile · 0.90
route.test.tsFile · 0.90

Calls 1

shortIdFunction · 0.90

Tested by

no test coverage detected