From 265c40fbef4223797dc4f47b19dd130c25e4bac3 Mon Sep 17 00:00:00 2001 From: kumang Date: Sun, 7 Jan 2024 23:31:14 +0200 Subject: [PATCH] added alternate repeatString test strings --- 02_repeatString/repeatString.spec.js | 10 +++++----- 02_repeatString/solution/repeatString-solution.spec.js | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/02_repeatString/repeatString.spec.js b/02_repeatString/repeatString.spec.js index 912ac20..c9e8d6e 100644 --- a/02_repeatString/repeatString.spec.js +++ b/02_repeatString/repeatString.spec.js @@ -5,16 +5,16 @@ describe('repeatString', () => { expect(repeatString('hey', 3)).toEqual('heyheyhey'); }); test.skip('repeats the string many times', () => { - expect(repeatString('hey', 10)).toEqual('heyheyheyheyheyheyheyheyheyhey'); + expect(repeatString('hello', 10)).toEqual('hellohellohellohellohellohellohellohellohellohello'); }); test.skip('repeats the string 1 times', () => { - expect(repeatString('hey', 1)).toEqual('hey'); + expect(repeatString('hi', 1)).toEqual('hi'); }); test.skip('repeats the string 0 times', () => { - expect(repeatString('hey', 0)).toEqual(''); + expect(repeatString('bye', 0)).toEqual(''); }); test.skip('returns ERROR with negative numbers', () => { - expect(repeatString('hey', -1)).toEqual('ERROR'); + expect(repeatString('goodbye', -1)).toEqual('ERROR'); }); test.skip('repeats the string a random amount of times', function () { /*The number is generated by using Math.random to get a value from between @@ -29,7 +29,7 @@ describe('repeatString', () => { /*The .match(/((hey))/g).length is a regex that will count the number of heys in the result, which if your function works correctly will equal the number that was randomly generated. */ - expect(repeatString('hey', number).match(/((hey))/g).length).toEqual(number); + expect(repeatString('odin', number).match(/((odin))/g).length).toEqual(number); }); test.skip('works with blank strings', () => { expect(repeatString('', 10)).toEqual(''); diff --git a/02_repeatString/solution/repeatString-solution.spec.js b/02_repeatString/solution/repeatString-solution.spec.js index c506ce1..d25625f 100644 --- a/02_repeatString/solution/repeatString-solution.spec.js +++ b/02_repeatString/solution/repeatString-solution.spec.js @@ -5,16 +5,16 @@ describe('repeatString', () => { expect(repeatString('hey', 3)).toEqual('heyheyhey'); }); test('repeats the string many times', () => { - expect(repeatString('hey', 10)).toEqual('heyheyheyheyheyheyheyheyheyhey'); + expect(repeatString('hello', 10)).toEqual('hellohellohellohellohellohellohellohellohellohello'); }); test('repeats the string 1 times', () => { - expect(repeatString('hey', 1)).toEqual('hey'); + expect(repeatString('hi', 1)).toEqual('hi'); }); test('repeats the string 0 times', () => { - expect(repeatString('hey', 0)).toEqual(''); + expect(repeatString('bye', 0)).toEqual(''); }); test('returns ERROR with negative numbers', () => { - expect(repeatString('hey', -1)).toEqual('ERROR'); + expect(repeatString('goodbye', -1)).toEqual('ERROR'); }); test('repeats the string a random amount of times', function () { /*The number is generated by using Math.random to get a value from between @@ -29,7 +29,7 @@ describe('repeatString', () => { /*The .match(/((hey))/g).length is a regex that will count the number of heys in the result, which if your function works correctly will equal the number that was randomaly generated. */ - expect(repeatString('hey', number).match(/((hey))/g).length).toEqual( + expect(repeatString('odin', number).match(/((odin))/g).length).toEqual( number ); });