Complete the code to import Express in a test file.
const express = require('[1]');
You import Express by requiring the 'express' package.
Complete the code to import the testing function from Vitest.
const { [1] } = require('vitest');The 'test' function is used to define test cases in Vitest.
Fix the error in importing the supertest library for HTTP testing.
const request = require('[1]');
The correct package name for HTTP testing with Express is 'supertest'.
Fill both blanks to create a simple test that checks the Express app response status.
test('GET / responds with 200', async () => { const response = await request([1]).get('/'); expect(response.status).toBe([2]); });
We use the Express app instance to send requests and expect a 200 status for success.
Fill all three blanks to setup a Vitest test file with Express and supertest.
const express = require('[1]'); const request = require('[2]'); const { test, expect } = require('[3]');
We import Express, supertest for HTTP testing, and Vitest functions for testing.
