-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.ts
26 lines (23 loc) 路 792 Bytes
/
test.ts
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
import {
assertEquals,
assertThrows,
} from "https://deno.land/std/testing/asserts.ts";
import * as validator from "./mod.ts";
Deno.test("Check the isEmpty", function (): void {
const str: string = "";
assertEquals(validator.isEmpty(str), true);
});
Deno.test("Check the isBoolean", function (): void {
const strTrue: string = "true";
const strFalse: string = "false";
const strZero: string = "0";
const strOne: string = "1";
assertEquals(validator.isBoolean(strTrue), true);
assertEquals(validator.isBoolean(strFalse), true);
assertEquals(validator.isBoolean(strZero), true);
assertEquals(validator.isBoolean(strOne), true);
});
Deno.test("Check the isNumeric", function (): void {
const str: string = "1000";
assertEquals(validator.isNumeric(str), true);
});