MCPcopy Index your code
hub / github.com/freeCodeCamp/freeCodeCamp / seedExam

Function seedExam

api/vitest.utils.ts:247–261  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

245}
246
247export async function seedExam(): Promise<void> {
248 const query = { where: { id: examJson.id } };
249 const testExamExists =
250 await fastifyTestInstance.prisma.exam.findUnique(query);
251
252 if (testExamExists) {
253 await fastifyTestInstance.prisma.exam.deleteMany(query);
254 }
255
256 await fastifyTestInstance.prisma.exam.create({
257 data: {
258 ...examJson
259 }
260 });
261}
262
263export function createFetchMock({ ok = true, body = {} } = {}) {
264 return vi.fn().mockResolvedValue(

Callers 1

challenge.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected