|
| 1 | +import { describe, expect, it, xit } from '@jest/globals' |
| 2 | +import { recite } from './bottle-song.ts' |
| 3 | + |
| 4 | +describe('Bottle Song', () => { |
| 5 | + describe('verse', () => { |
| 6 | + describe('single verse', () => { |
| 7 | + it('first generic verse', () => { |
| 8 | + const expected = [ |
| 9 | + `Ten green bottles hanging on the wall,`, |
| 10 | + `Ten green bottles hanging on the wall,`, |
| 11 | + `And if one green bottle should accidentally fall,`, |
| 12 | + `There'll be nine green bottles hanging on the wall.`, |
| 13 | + ] |
| 14 | + expect(recite(10, 1)).toEqual(expected) |
| 15 | + }) |
| 16 | + |
| 17 | + xit('last generic verse', () => { |
| 18 | + const expected = [ |
| 19 | + `Three green bottles hanging on the wall,`, |
| 20 | + `Three green bottles hanging on the wall,`, |
| 21 | + `And if one green bottle should accidentally fall,`, |
| 22 | + `There'll be two green bottles hanging on the wall.`, |
| 23 | + ] |
| 24 | + expect(recite(3, 1)).toEqual(expected) |
| 25 | + }) |
| 26 | + |
| 27 | + xit('verse with 2 bottles', () => { |
| 28 | + const expected = [ |
| 29 | + `Two green bottles hanging on the wall,`, |
| 30 | + `Two green bottles hanging on the wall,`, |
| 31 | + `And if one green bottle should accidentally fall,`, |
| 32 | + `There'll be one green bottle hanging on the wall.`, |
| 33 | + ] |
| 34 | + expect(recite(2, 1)).toEqual(expected) |
| 35 | + }) |
| 36 | + |
| 37 | + xit('verse with 1 bottle', () => { |
| 38 | + const expected = [ |
| 39 | + `One green bottle hanging on the wall,`, |
| 40 | + `One green bottle hanging on the wall,`, |
| 41 | + `And if one green bottle should accidentally fall,`, |
| 42 | + `There'll be no green bottles hanging on the wall.`, |
| 43 | + ] |
| 44 | + expect(recite(1, 1)).toEqual(expected) |
| 45 | + }) |
| 46 | + }) |
| 47 | + }) |
| 48 | + |
| 49 | + describe('lyrics', () => { |
| 50 | + describe('multiple verses', () => { |
| 51 | + xit('first two verses', () => { |
| 52 | + const expected = [ |
| 53 | + `Ten green bottles hanging on the wall,`, |
| 54 | + `Ten green bottles hanging on the wall,`, |
| 55 | + `And if one green bottle should accidentally fall,`, |
| 56 | + `There'll be nine green bottles hanging on the wall.`, |
| 57 | + ``, |
| 58 | + `Nine green bottles hanging on the wall,`, |
| 59 | + `Nine green bottles hanging on the wall,`, |
| 60 | + `And if one green bottle should accidentally fall,`, |
| 61 | + `There'll be eight green bottles hanging on the wall.`, |
| 62 | + ] |
| 63 | + expect(recite(10, 2)).toEqual(expected) |
| 64 | + }) |
| 65 | + |
| 66 | + xit('last three verses', () => { |
| 67 | + const expected = [ |
| 68 | + `Three green bottles hanging on the wall,`, |
| 69 | + `Three green bottles hanging on the wall,`, |
| 70 | + `And if one green bottle should accidentally fall,`, |
| 71 | + `There'll be two green bottles hanging on the wall.`, |
| 72 | + ``, |
| 73 | + `Two green bottles hanging on the wall,`, |
| 74 | + `Two green bottles hanging on the wall,`, |
| 75 | + `And if one green bottle should accidentally fall,`, |
| 76 | + `There'll be one green bottle hanging on the wall.`, |
| 77 | + ``, |
| 78 | + `One green bottle hanging on the wall,`, |
| 79 | + `One green bottle hanging on the wall,`, |
| 80 | + `And if one green bottle should accidentally fall,`, |
| 81 | + `There'll be no green bottles hanging on the wall.`, |
| 82 | + ] |
| 83 | + expect(recite(3, 3)).toEqual(expected) |
| 84 | + }) |
| 85 | + |
| 86 | + xit('all verses', () => { |
| 87 | + const expected = [ |
| 88 | + `Ten green bottles hanging on the wall,`, |
| 89 | + `Ten green bottles hanging on the wall,`, |
| 90 | + `And if one green bottle should accidentally fall,`, |
| 91 | + `There'll be nine green bottles hanging on the wall.`, |
| 92 | + ``, |
| 93 | + `Nine green bottles hanging on the wall,`, |
| 94 | + `Nine green bottles hanging on the wall,`, |
| 95 | + `And if one green bottle should accidentally fall,`, |
| 96 | + `There'll be eight green bottles hanging on the wall.`, |
| 97 | + ``, |
| 98 | + `Eight green bottles hanging on the wall,`, |
| 99 | + `Eight green bottles hanging on the wall,`, |
| 100 | + `And if one green bottle should accidentally fall,`, |
| 101 | + `There'll be seven green bottles hanging on the wall.`, |
| 102 | + ``, |
| 103 | + `Seven green bottles hanging on the wall,`, |
| 104 | + `Seven green bottles hanging on the wall,`, |
| 105 | + `And if one green bottle should accidentally fall,`, |
| 106 | + `There'll be six green bottles hanging on the wall.`, |
| 107 | + ``, |
| 108 | + `Six green bottles hanging on the wall,`, |
| 109 | + `Six green bottles hanging on the wall,`, |
| 110 | + `And if one green bottle should accidentally fall,`, |
| 111 | + `There'll be five green bottles hanging on the wall.`, |
| 112 | + ``, |
| 113 | + `Five green bottles hanging on the wall,`, |
| 114 | + `Five green bottles hanging on the wall,`, |
| 115 | + `And if one green bottle should accidentally fall,`, |
| 116 | + `There'll be four green bottles hanging on the wall.`, |
| 117 | + ``, |
| 118 | + `Four green bottles hanging on the wall,`, |
| 119 | + `Four green bottles hanging on the wall,`, |
| 120 | + `And if one green bottle should accidentally fall,`, |
| 121 | + `There'll be three green bottles hanging on the wall.`, |
| 122 | + ``, |
| 123 | + `Three green bottles hanging on the wall,`, |
| 124 | + `Three green bottles hanging on the wall,`, |
| 125 | + `And if one green bottle should accidentally fall,`, |
| 126 | + `There'll be two green bottles hanging on the wall.`, |
| 127 | + ``, |
| 128 | + `Two green bottles hanging on the wall,`, |
| 129 | + `Two green bottles hanging on the wall,`, |
| 130 | + `And if one green bottle should accidentally fall,`, |
| 131 | + `There'll be one green bottle hanging on the wall.`, |
| 132 | + ``, |
| 133 | + `One green bottle hanging on the wall,`, |
| 134 | + `One green bottle hanging on the wall,`, |
| 135 | + `And if one green bottle should accidentally fall,`, |
| 136 | + `There'll be no green bottles hanging on the wall.`, |
| 137 | + ] |
| 138 | + expect(recite(10, 10)).toEqual(expected) |
| 139 | + }) |
| 140 | + }) |
| 141 | + }) |
| 142 | +}) |
0 commit comments