From d8bf875c968a7ec5b1df9961f546bd5efaf6e9f1 Mon Sep 17 00:00:00 2001 From: Derk-Jan Karrenbeld Date: Wed, 2 Jul 2025 16:25:57 +0200 Subject: [PATCH] Fix enchantments.spec.js One describe per task! --- .../elyses-enchantments/enchantments.spec.js | 46 ++++++++----------- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/exercises/concept/elyses-enchantments/enchantments.spec.js b/exercises/concept/elyses-enchantments/enchantments.spec.js index cb20e143b4..15cdf6e5b7 100644 --- a/exercises/concept/elyses-enchantments/enchantments.spec.js +++ b/exercises/concept/elyses-enchantments/enchantments.spec.js @@ -242,42 +242,34 @@ describe('make the bottom card disappear', () => { }); describe('check your work', () => { - describe('an empty stack of cards', () => { - test('has 0 cards', () => { - const stack = []; + test('an empty stack of cards has 0 cards', () => { + const stack = []; - expect(checkSizeOfStack(stack, 0)).toBe(true); - expect(checkSizeOfStack(stack, 1)).toBe(false); - }); + expect(checkSizeOfStack(stack, 0)).toBe(true); + expect(checkSizeOfStack(stack, 1)).toBe(false); }); - describe('a stack with a single card', () => { - test('has exactly 1 card', () => { - const stack = [7]; + test('a stack with a single card has exactly 1 card', () => { + const stack = [7]; - expect(checkSizeOfStack(stack, 0)).toBe(false); - expect(checkSizeOfStack(stack, 1)).toBe(true); - expect(checkSizeOfStack(stack, 2)).toBe(false); - }); + expect(checkSizeOfStack(stack, 0)).toBe(false); + expect(checkSizeOfStack(stack, 1)).toBe(true); + expect(checkSizeOfStack(stack, 2)).toBe(false); }); - describe('a stack with the even cards', () => { - test('has exactly 4 cards', () => { - const stack = [2, 4, 6, 8]; + test('a stack with the even cards has exactly 4 cards', () => { + const stack = [2, 4, 6, 8]; - expect(checkSizeOfStack(stack, 3)).toBe(false); - expect(checkSizeOfStack(stack, 4)).toBe(true); - expect(checkSizeOfStack(stack, 5)).toBe(false); - }); + expect(checkSizeOfStack(stack, 3)).toBe(false); + expect(checkSizeOfStack(stack, 4)).toBe(true); + expect(checkSizeOfStack(stack, 5)).toBe(false); }); - describe('a stack with the odd cards', () => { - test('has exactly 5 cards', () => { - const stack = [1, 3, 5, 7, 9]; + test('a stack with the odd cards has exactly 5 cards', () => { + const stack = [1, 3, 5, 7, 9]; - expect(checkSizeOfStack(stack, 3)).toBe(false); - expect(checkSizeOfStack(stack, 4)).toBe(false); - expect(checkSizeOfStack(stack, 5)).toBe(true); - }); + expect(checkSizeOfStack(stack, 3)).toBe(false); + expect(checkSizeOfStack(stack, 4)).toBe(false); + expect(checkSizeOfStack(stack, 5)).toBe(true); }); });