You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importtestfrom'ava';constrequest=require('supertest');constapp=require('./../app.js');test('check status',asynct=>{constresponse=awaitrequest(app).get('/status');t.is(response.status,200);t.deepEqual(response.body,{status : 'Ok'});})test('greet',asynct=>{constname='Nitish';constfood='Pizza';constresponse=awaitrequest(app).get('/greet').query({name, food});t.is(response.status,200);t.is(response.body.message,`hello ${name} would you like a ${food}`);})test('Dont send username',asynct=>{constpassword='some-hase'constresponse=awaitrequest(app).post('/register').send({password});t.is(response.status,400);t.is(response.body.message,`username is missing`);})test('Dont send password',asynct=>{constusername='some-hase'constresponse=awaitrequest(app).post('/register').send({username});t.is(response.status,400);t.is(response.body.message,`password is missing`);})
The text was updated successfully, but these errors were encountered:
Useful article: How you can test your Node.js applications with Ava.js
The text was updated successfully, but these errors were encountered: