From 312103dc4f18117f4a6bab41ae830f3b796ec539 Mon Sep 17 00:00:00 2001 From: Christopher Martinez <59293631+Timework@users.noreply.github.com> Date: Fri, 1 May 2020 12:44:55 -0500 Subject: [PATCH] Added random test I added a random test getting a number from 1 to 1000. You said you wanted comments on it but I was not sure where to put them. I added the global modifier to the recommended regex in order for it count all the words properly. --- repeatString/repeatString.spec.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/repeatString/repeatString.spec.js b/repeatString/repeatString.spec.js index 931b437..68a3f64 100644 --- a/repeatString/repeatString.spec.js +++ b/repeatString/repeatString.spec.js @@ -16,4 +16,8 @@ describe('repeatString', function() { xit('returns ERROR with negative numbers', function() { expect(repeatString('hey', -1)).toEqual('ERROR'); }); + xit('repeats the string a random amount of times', function () { + let number = Math.floor(Math.random() * 1000) + expect(repeatString('hey', number).match(/((hey))/g).length).toEqual(number); + }); });