-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
28 lines (23 loc) · 905 Bytes
/
Copy pathtest.js
File metadata and controls
28 lines (23 loc) · 905 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
var assert = require('assert');
var mockery = require('mockery');
var WebhookParser = require('./webhookParser');
describe("webhook parser", function () {
it('top url', function (done) {
var webhookParser = new WebhookParser('test.txt');
var expects = [];
expects.push({'https://woodenoyster.com.br' : 3});
expects.push({'https://grimpottery.net.br': 2});
expects.push({'https://grotesquemoon.de' : 1});
webhookParser.getTopUrl(3, function (result) {
assert.deepEqual(result, expects);
done();
});
});
it('table of status', function (done) {
var webhookParser = new WebhookParser('test.txt');
webhookParser.getStatusTable(function (result) {
assert.deepEqual(result, { '200': 1, '201': 1, '400': 3, '404': 3, '500': 2, '503': 1 });
done();
});
});
});