-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6109acc
commit 9a42da3
Showing
1 changed file
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,22 @@ | ||
import { assertEquals } from "./test_deps.ts"; | ||
import { validateTLD } from "./mod.ts"; | ||
|
||
Deno.test("Test with defaults", () => { | ||
assertEquals(validateTLD("in"), true); | ||
Deno.test("Test with lowercase input", () => { | ||
const input = "in"; | ||
assertEquals(validateTLD(input), true); | ||
}); | ||
|
||
Deno.test("Test with uppercase input", () => { | ||
const input = "IN"; | ||
assertEquals(validateTLD(input), true); | ||
}); | ||
|
||
Deno.test("Test with unhappy path", () => { | ||
const input = "zebra"; | ||
assertEquals(validateTLD(input), false); | ||
}); | ||
|
||
Deno.test("Test with happy path", () => { | ||
const input = "PHOTOGRAPHY"; | ||
assertEquals(validateTLD(input), true); | ||
}); |