-
Notifications
You must be signed in to change notification settings - Fork 0
/
output.test.ts
54 lines (46 loc) · 1.31 KB
/
output.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
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
import { assertEquals } from "https://deno.land/std/testing/asserts.ts";
import Output, { AutomatonOutput } from "./output.ts";
Deno.test("Should initialize silent", () => {
new Output({
silent: true,
});
});
Deno.test("Should initialize with no options", () => {
new Output();
});
Deno.test("Should initialize automaton output silent", () => {
new AutomatonOutput({
silent: true,
});
});
Deno.test("Should initialize automaton output with no options", () => {
new AutomatonOutput();
});
Deno.test("Should get success message", () => {
const output = new AutomatonOutput({
silent: true,
});
const result = output.success();
assertEquals(result, '🎉 Your input was accepted!');
});
Deno.test("Should get failure message", () => {
const output = new AutomatonOutput({
silent: true,
});
const result = output.failure();
assertEquals(result, "👻 Your input was rejected");
});
Deno.test("Should get dynamic message (true)", () => {
const output = new AutomatonOutput({
silent: true,
});
const result = output.printResult(true);
assertEquals(result, "🎉 Your input was accepted!");
});
Deno.test("Should get dynamic message (true)", () => {
const output = new AutomatonOutput({
silent: true,
});
const result = output.printResult(false);
assertEquals(result, "👻 Your input was rejected")
});