MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / withKiloPassTestUser

Function withKiloPassTestUser

packages/db/src/schema.test.ts:21–39  ·  view source on GitHub ↗
(
  testFn: (params: { userId: string }) => Promise<void>
)

Source from the content-addressed store, hash-verified

19
20const schemaTestDb = createDrizzleClient({
21 connectionString: computeDatabaseUrl(),
22 poolConfig: { application_name: 'db-schema-test', max: 1 },
23});
24
25afterAll(async () => {
26 await schemaTestDb.pool.end();
27});
28
29describe('kilocode_users pepper default', () => {
30 it('gives a new account a pepper so a rotation revokes every token it can mint', async () => {
31 const pepperUserId = `oauth/schema-pepper-${crypto.randomUUID()}`;
32 try {
33 const [user] = await schemaTestDb.db
34 .insert(schema.kilocode_users)
35 .values({
36 id: pepperUserId,
37 google_user_email: `${pepperUserId}@example.com`,
38 google_user_name: 'Schema pepper test',
39 google_user_image_url: '',
40 stripe_customer_id: `cus_${crypto.randomUUID()}`,
41 })
42 .returning();

Callers 1

schema.test.tsFile · 0.85

Calls 2

valuesMethod · 0.65
deleteMethod · 0.65

Tested by

no test coverage detected