-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
66 lines (50 loc) · 1.06 KB
/
test.js
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import test from 'ava';
var app = require('./index.js');
/**
* API
*/
test('apiUri', t => {
t.is(app.options.uri, 'https://api.uptimerobot.com/v2/getMonitors');
});
test('apiMethod', t => {
t.is(app.options.method, 'POST');
});
/**
* Monitor Types
*/
test('typeHttps', t => {
t.is(app.monitorType(1), 'HTTP(s)');
});
test('typeKeyword', t => {
t.is(app.monitorType(2), 'Keyword');
});
test('typePing', t => {
t.is(app.monitorType(3), 'Ping');
});
test('typePort', t => {
t.is(app.monitorType(4), 'Port');
});
test('typeUnknown', t => {
t.is(app.monitorType(5), 'Unknown');
});
/**
* Monitor Statuses
*/
test('statusPaused', t => {
t.is(app.monitorStatus(0), 'Paused');
});
test('statusNotCheckedYet', t => {
t.is(app.monitorStatus(1), 'Not Checked Yet');
});
test('statusUp', t => {
t.is(app.monitorStatus(2), 'Up');
});
test('statusSeemsDown', t => {
t.is(app.monitorStatus(8), 'Seems Down');
});
test('statusDown', t => {
t.is(app.monitorStatus(9), 'Down');
});
test('statusUnknown', t => {
t.is(app.monitorStatus(20), 'Unknown');
});