garbados / dat-gateway

In-memory Dat to HTTP gateway
https://dat.bovid.space/
61 stars 13 forks source link

feat(testing): mock outgoing HTTP requests #24

Closed garbados closed 5 years ago

garbados commented 5 years ago

This PR disables outgoing HTTP requests during tests unless the environment variable RECORD_TESTS is set, in which case outgoing HTTP requests are saved as mocks. This ensures tests run faster and have consistent inputs.

This PR also updates a number of dependencies and applies standard's latest style guide to the source code.

coveralls commented 5 years ago

Pull Request Test Coverage Report for Build 78


Changes Missing Coverage Covered Lines Changed/Added Lines %
index.js 13 15 86.67%
<!-- Total: 13 15 86.67% -->
Files with Coverage Reduction New Missed Lines %
index.js 9 65.89%
<!-- Total: 9 -->
Totals Coverage Status
Change from base Build 75: -4.2%
Covered Lines: 103
Relevant Lines: 154

💛 - Coveralls
garbados commented 5 years ago

This PR elects to skip the failing websockets test, and an issue has been opened (#25) to address it.