From 374d5a32f56cb47a6adcd622f987aa0be7a512a8 Mon Sep 17 00:00:00 2001 From: zainabdnaya Date: Thu, 19 Oct 2023 08:18:31 -0400 Subject: [PATCH] TEST(wave): add test file for wave function --- js/tests/wave_test.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 js/tests/wave_test.js diff --git a/js/tests/wave_test.js b/js/tests/wave_test.js new file mode 100644 index 000000000..be1e5d019 --- /dev/null +++ b/js/tests/wave_test.js @@ -0,0 +1,11 @@ +export const tests = [] +const t = (f) => tests.push(f) +t(({ eq }) => eq(wave('hello'), ['Hello', 'hEllo', 'heLlo', 'helLo', 'hellO'])) +t(({ eq }) => eq(wave('codewars'), ['Codewars', 'cOdewars', 'coDewars', 'codEwars', 'codeWars', 'codewArs', 'codewaRs', 'codewarS'])) +t(({ eq }) => eq(wave('two words'), ['Two words', 'tWo words', 'twO words', 'two Words', 'two wOrds', 'two woRds', 'two worDs', 'two wordS'])) +t(({ eq }) => eq(wave(' gap '), [' Gap ', ' gAp ', ' gaP '])) +t(({ eq }) => eq(wave(''), [])) +t(({ eq }) => eq(wave('a b '), ['A b ', 'a B '])) +t(({eq}) => eq(wave('12345'), ['12345', '12345', '12345', '12345', '12345'])) + +Object.freeze(tests) \ No newline at end of file