-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
41 lines (35 loc) · 1.09 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
const assert = require("assert");
const {
checkWithPing,
checkWithCurl,
checkWithWget,
checkWithNet,
checkWithAxios,
checkWithHttps,
} = require("./index");
describe("Internet Connectivity Tests", function () {
it("should check with ping", function () {
const result = checkWithPing();
assert.strictEqual(typeof result, "boolean");
});
it("should check with curl", function () {
const result = checkWithCurl();
assert.strictEqual(typeof result, "boolean");
});
it("should check with wget", function () {
const result = checkWithWget();
assert.strictEqual(typeof result, "boolean");
});
it("should check with net module", async function () {
const result = await checkWithNet();
assert.strictEqual(typeof result, "boolean");
});
it("should check with axios module", async function () {
const result = await checkWithAxios();
assert.strictEqual(typeof result, "boolean");
});
it("should check with https module", async function () {
const result = await checkWithHttps();
assert.strictEqual(typeof result, "boolean");
});
});