YvensY
Convex Community2y ago
41 replies
Yvens

Convex-test/ents

Is there a way to use ctx.table in a test ?

  await t.run(async (ctx) => {
    // roles created
    ctx.table("users").insert({ firstname, roles: [roleId1, roleId2] })
  });

Or should I insert data in the "users_to_roles" table created by ents ?
`
  const t = convexTest(schema);
  await t.run(async (ctx) => {
    // roles created
    // users created
    ctx.db.insert("users_to_roles", { userId, roleId })
  });

I don't get how to re-create the edge in my db setup.

Thank you
Was this page helpful?