Supertest express tutorial | Node REST API testing

preview_player
Показать описание

00:50 installing supertest and Jest
02:24 restructuring our project to make it ready for testing
04:14 writing integration tests with supertest
05:47 making a post request with supertest
06:25 assertions with jest and supertest
08:44 running our tests
09:06 conclusion

Рекомендации по теме
Комментарии
Автор

What do you think about this video?
Was the explanation clear?

jgoebel
Автор

The section "restructuring our project to make it ready for testing" was what I had been searching for for at least an hour. Thank you!

leonardokala
Автор

Great vid. Great example. Since you've provided this good example, I would like to know what supertest actually is, and what it's for in general terms. Is it just something that allows Jest to work for requests, or does it do other stuff?

jamesdaniels
Автор

Please make a video on mocking the MongoDB/mongoose as part 2 of this specific video 👍

HarryManchanda
Автор

This is very Helpful, But I have a big question how do you do unit test using a database like PostgreSQL with sequelize, My test run to issues trying to connect to the DB

miguelrodriguez
Автор

How do we test an api rest if you have the cors enabled?

garyyaral
Автор

req.body is showing undefined in my routes

sounikchakraborty