-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from HarryPeach/dev
Added .getText() and .getFrame(), and new tests
- Loading branch information
Showing
4 changed files
with
39 additions
and
5 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
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
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,4 +1,4 @@ | ||
import Kia, { forPromise } from "./mod.ts"; | ||
import Kia, { forPromise, Spinners } from "./mod.ts"; | ||
import { assertThrows } from "https://deno.land/[email protected]/testing/asserts.ts"; | ||
import { expect } from "https://deno.land/x/expect/mod.ts"; | ||
class TestWriter implements Deno.WriterSync { | ||
|
@@ -145,3 +145,16 @@ Deno.test("hidden cursor is returned", () => { | |
.includes("\x1b[?25h") | ||
).toBe(true); | ||
}); | ||
|
||
Deno.test("getFrame gets the correct frame", async () => { | ||
const testWriter = new TestWriter(); | ||
const kia = new Kia({writer: testWriter, spinner: Spinners.windows}); | ||
expect(kia.getFrame()).toBe("/"); | ||
}); | ||
|
||
Deno.test("getText gets the correct text", async () => { | ||
const TEST_TEXT = "This is sample text"; | ||
const testWriter = new TestWriter(); | ||
const kia = new Kia({writer: testWriter, text: TEST_TEXT}); | ||
expect(kia.getText()).toEqual(TEST_TEXT); | ||
}); |
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