Skip to content
This repository has been archived by the owner on Dec 16, 2021. It is now read-only.

Commit

Permalink
feat: getStatus functional test
Browse files Browse the repository at this point in the history
  • Loading branch information
jawid-h authored Feb 20, 2020
1 parent 43ff8c9 commit 3f3ec06
Showing 1 changed file with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
const startDapi = require('@dashevo/dp-services-ctl/lib/services/startDapi');

describe('getStatusHandlerFactory', function main() {
this.timeout(160000);

let removeDapi;
let dapiClient;

beforeEach(async () => {
const {
dapiCore,
dashCore,
remove,
} = await startDapi();

removeDapi = remove;

dapiClient = dapiCore.getApi();

await (dashCore.getApi()).generate(1000);
});

afterEach(async () => {
await removeDapi();
});

it('should return status', async () => {
const result = await dapiClient.getStatus();

expect(result).to.have.a.property('coreVersion');
expect(result).to.have.a.property('protocolVersion');
expect(result).to.have.a.property('blocks');
expect(result).to.have.a.property('timeOffset');
expect(result).to.have.a.property('connections');
expect(result).to.have.a.property('proxy');
expect(result).to.have.a.property('difficulty');
expect(result).to.have.a.property('testnet');
expect(result).to.have.a.property('relayFee');
expect(result).to.have.a.property('errors');
expect(result).to.have.a.property('network');

expect(result.blocks).to.equal(1000);
});
});

0 comments on commit 3f3ec06

Please sign in to comment.