TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: What's the best way to unit test a RESTFul API?

3 pointsby zabanaalmost 8 years ago
I wrote a RESTful web API for a side project of mine (https://wintermute.design), and I tested it using mocha and chai (the API is written in express JS). But recently I read different articles which advise against such practice and recommend using mocks instead. What's your opinion on this ? How would you go about testing your own API if you had to write one today ?

1 comment

mjhea0almost 8 years ago
Mocha + Chai along with Sinon (<a href="http:&#x2F;&#x2F;sinonjs.org&#x2F;" rel="nofollow">http:&#x2F;&#x2F;sinonjs.org&#x2F;</a>) for stubbing and mocking.