mirror of
https://github.com/10h30/odin-javascript-exercises.git
synced 2026-06-05 15:09:09 +09:00
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.
This commit is contained in:
committed by
GitHub
parent
26d610ca6e
commit
312103dc4f
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user