Skip to content

Commit

Permalink
test(morse-code-decoder): HackerRank scenarios 2 and 3
Browse files Browse the repository at this point in the history
  • Loading branch information
jebarsoba committed Mar 30, 2022
1 parent c5ce031 commit 0d212a1
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions hackerrank/morse-code-decoder.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,26 @@ describe("morse code decoding", () => {
});

describe("HackerRank tests, based on provided input and expected output", () => {
it("test case 2", async () => {
const data = await readFileAsync(
"./morse-code-decoder.data.raw.txt",
"utf8"
);
const input = parseInput(data);

expect(decode(".....--....", input.dictionary, input.context)).toBe("HATH");
});

it("test case 3", async () => {
const data = await readFileAsync(
"./morse-code-decoder.data.raw.txt",
"utf8"
);
const input = parseInput(data);

expect(decode("--.----..", input.dictionary, input.context)).toBe("GOD");
});

it("test case 4", async () => {
const data = await readFileAsync(
"./morse-code-decoder.data.raw.txt",
Expand Down

0 comments on commit 0d212a1

Please sign in to comment.