forwardemail / forwardemail/supertest

Its is a good practice for Next.js?

Open
#816 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
14.4k
Forks
782
PR merge metrics
No merged PRs in 30d

Description

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](https://user-images.githubusercontent.com/90145877/215920491-ce395b1b-90e2-4886-b57c-b41382a9fd4a.png)

I'v tried it creating a server like this:

![image](https://user-images.githubusercontent.com/90145877/215920546-3c585297-103f-4b7f-9b54-6167f0dc52d1.png)

And the test folder:

![image](https://user-images.githubusercontent.com/90145877/215920629-10a7687a-62a6-4374-890f-142946d07612.png)

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.