add some test

This commit is contained in:
2024-05-13 23:10:24 +02:00
parent 5a0ceadcc6
commit e5d6987b10
2 changed files with 68 additions and 12 deletions

View File

@ -10,17 +10,7 @@ let serveur : Server<typeof IncomingMessage, typeof ServerResponse>
describe("Test the welcome path", () => {
beforeEach(() => {
serveur = app.listen(port, () =>{
console.log(`serveur running in ${port}`)
})
})
afterEach((done) => {
serveur.close(done)
})
test("It should response the GET method", done => {
test("It should response the 200 code for GET method", done => {
request(app)
.get("/welcome")
.then(response => {
@ -29,7 +19,7 @@ describe("Test the welcome path", () => {
});
});
test("It should response the GET method", done => {
test("It should response the GET method with content", done => {
const out = {hello:"world"};
request(app)
.get("/welcome")