Kuis Testing API — Node.js

Kuis materi Testing API di Node.js — uji pemahamanmu dengan pertanyaan pilihan ganda, penjelasan jawaban, dan skor langsung. Main gratis di Hyper Sheets.

Pertanyaan di kuis ini

  1. Library testing populer untuk Node.js?
  2. Test HTTP request dengan supertest:
    const response = await request(app).___('api/siswa');
  3. Assert status code di supertest:
    await request(app).get('/').___( 200);
  4. describe("GET /api/siswa", () => {
      it("harus return status 200", async () => {
        const res = await request(app).get("/api/siswa");
        expect(res.status).toBe(200);
      });
    });

    Apa fungsi describe di sini?
  5. Kenapa kita me-mock database di unit test?