forwardemail / forwardemail/supertest

Document how to run tests against a remote server.

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

Description

I'm evaluating SuperTest for use as an end-to-end testing framework for an API implemented in PHP. So I need to run the tests via actual HTTP against some configurable base URL. After a lot of poking around, I found that I can just pass that base URL to the module's constructor, as in

request( 'http://localhost:8080/dummy/' ).get('api.php')

This is undocumented though, and even violates the documentation in index.js, which requires the parameter to be a Function or a http.Server. Is there a better way to achieve what I want? If not, I'd propose to document the fact that the module can be initialized with a base URL like this.

PS: request( app ).get('http://localhost:8080/dummy/api.php') didn't work for me, it would always return a 404, no matter what URL I fed in. Couldn't figure out why. I'm new to node.js though, maybe I was just confused.

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.