Skip to content

API test does not work with current "isomorphic" fetch #1

Description

@lucas-barros

The current API lib is used on both the server (SSR) and the client side. I currently use process.env.PORT to see if the code is executed on client or server in order to get the API address.

apiAddress = (process.env.PORT) ? `http://127.0.0.1:${process.env.PORT}/api/users` : '/api/users'

The problem is that when executing the tests, the process.env.PORT is undefined.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions