passed ERROR test

This commit is contained in:
Mohammed Nabeel 2020-07-16 09:06:49 +03:00
parent 1149e755e5
commit 52356b2eb6
2 changed files with 5 additions and 6 deletions

View File

@ -2,13 +2,12 @@ const repeatString = function(string, number) {
let result = '';
if (number < 0) {
return 'ERROR';
}
for (let i = 0; i < number; i++) {
if (number < 0) {
return 'ERROR';
}
result += string;
}
return result;

View File

@ -13,7 +13,7 @@ describe('repeatString', function() {
it('repeats the string 0 times', function() {
expect(repeatString('hey', 0)).toEqual('');
});
xit('returns ERROR with negative numbers', function() {
it('returns ERROR with negative numbers', function() {
expect(repeatString('hey', -1)).toEqual('ERROR');
});
xit('repeats the string a random amount of times', function() {