-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.test.js
36 lines (32 loc) · 829 Bytes
/
app.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { describe, it } from "node:test";
import supertest from "supertest";
import { app } from "./app.js";
describe('GET /', () => {
it('Returns index page', async () => {
const response = await supertest(app)
.get('/')
.expect('Content-Type', 'text/html; charset=utf-8')
.expect(200);
});
});
describe('GET /new', () => {
it('Returns new message page', async () => {
const response = await supertest(app)
.get('/new')
.expect('Content-Type', 'text/html; charset=utf-8')
.expect(200);
});
});
describe('POST /new', () => {
it('Posts a new note', async () => {
const response = await supertest(app)
.post('/new');
});
});
describe('GET /details/:id', () => {
it('Retrieves note details', async () => {
const response = await supertest(app)
.get('/details/0')
.expect(200);
});
});