This repository has been archived by the owner on Jun 27, 2024. It is now read-only.
forked from exercism/typescript
-
Notifications
You must be signed in to change notification settings - Fork 1
/
proverb.test.ts
34 lines (28 loc) · 1.58 KB
/
proverb.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
import Proverb from "./proverb"
describe("Proverb", () => {
it("a single consequence", () => {
const expected = `For want of a nail the shoe was lost.\nAnd all for the want of a nail.`
expect(Proverb("nail", "shoe")).toEqual(expected)
})
xit("a short chain of consequences", () => {
const expected = `For want of a nail the shoe was lost.\nFor want of a shoe the horse was lost.\nAnd all for the want of a nail.`
expect(Proverb("nail", "shoe", "horse")).toEqual(expected)
})
xit("a longer chain of consequences", () => {
const expected = `For want of a nail the shoe was lost.\nFor want of a shoe the horse was lost.\nFor want of a horse the rider was lost.\nAnd all for the want of a nail.`
expect(Proverb("nail", "shoe", "horse", "rider")).toEqual(expected)
})
xit("proverb function does not hard code the rhyme dictionary", () => {
const expected = `For want of a key the value was lost.\nAnd all for the want of a key.`
expect(Proverb("key", "value")).toEqual(expected)
})
xit("the whole proveb", () => {
const expected = `For want of a nail the shoe was lost.\nFor want of a shoe the horse was lost.\nFor want of a horse the rider was lost.\nFor want of a rider the message was lost.\nFor want of a message the battle was lost.\nFor want of a battle the kingdom was lost.\nAnd all for the want of a nail.`
expect(
Proverb("nail", "shoe", "horse", "rider", "message", "battle", "kingdom")
).toEqual(expected)
})
xit("proverb is the same each time", () => {
expect(Proverb("nail", "shoe")).toEqual(Proverb("nail", "shoe"))
})
})