Page MenuHomePhabricator

[alias-server] Refactor to support unit testing of API endpoints
ClosedPublic

Authored by bytesofman on Jun 23 2023, 16:52.

Details

Summary

T3060

Refactor to support unit testing of API endpoints.

Following express documentation and mochajs example at https://github.com/mochajs/mocha-examples/tree/master/packages/express-rest-api

Remove the express app from main.js. Refactor index.js so that the app initializes the db first before passing this to the express server and the indexer.

Add unit test for existing API endpoint.

Test Plan

npm test

Diff Detail

Repository
rABC Bitcoin ABC
Branch
alias-from-alias-endpoint
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 24154
Build 47918: Build Diffalias-server-tests
Build 47917: arc lint + arc unit