Skip to content
This repository has been archived by the owner on Feb 28, 2022. It is now read-only.

Commit

Permalink
tests for /stats
Browse files Browse the repository at this point in the history
  • Loading branch information
montyanderson committed Feb 12, 2019
1 parent d26037e commit 173cea1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/server.unit.js
Expand Up @@ -36,4 +36,16 @@ describe('yacdn', () => {
assert.strictEqual(data, testResult);
});
});

describe('/stats', () => {
it('should return data of correct types', async () => {
const {data} = await axios.get('http://localhost:3000/stats');

assert.strictEqual(typeof data, 'object');
assert.strictEqual(typeof data.cdnHits, 'number');
assert.strictEqual(typeof data.cdnData, 'number');
assert.strictEqual(typeof data.proxyHits, 'number');
assert.strictEqual(typeof data.proxyData, 'number');
});
});
});

0 comments on commit 173cea1

Please sign in to comment.