ladjs / supertest

🕷 Super-agent driven library for testing node.js HTTP servers using a fluent API. Maintained for @forwardemail, @ladjs, @spamscanner, @breejs, @cabinjs, and @lassjs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Its is a good practice for Next.js?

LksR-dev opened this issue · comments

Im trying TDD with Next.js, supertest and jest. I dont know If Im doing good.

Repo: https://github.com/LksR-dev/crud-nextjs-ts

The process.env.BASE_URL_LOCAL is the localhost, Every time I run the test it makes an actual API call and writes the database.

image

I'v tried it creating a server like this:

image

And the test folder:

image

But doing this way, the app doesn't acknowledges the env variables.