Skip to content

Commit 1c322dd

Browse files
Merge pull request TheOdinProject#420 from kumang-subba/repeatstring_test_alternate_strings
added alternate repeatString test strings
2 parents 8209109 + 9a5cdec commit 1c322dd

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

02_repeatString/repeatString.spec.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ describe('repeatString', () => {
55
expect(repeatString('hey', 3)).toEqual('heyheyhey');
66
});
77
test.skip('repeats the string many times', () => {
8-
expect(repeatString('hey', 10)).toEqual('heyheyheyheyheyheyheyheyheyhey');
8+
expect(repeatString('hello', 10)).toEqual('hellohellohellohellohellohellohellohellohellohello');
99
});
1010
test.skip('repeats the string 1 times', () => {
11-
expect(repeatString('hey', 1)).toEqual('hey');
11+
expect(repeatString('hi', 1)).toEqual('hi');
1212
});
1313
test.skip('repeats the string 0 times', () => {
14-
expect(repeatString('hey', 0)).toEqual('');
14+
expect(repeatString('bye', 0)).toEqual('');
1515
});
1616
test.skip('returns ERROR with negative numbers', () => {
17-
expect(repeatString('hey', -1)).toEqual('ERROR');
17+
expect(repeatString('goodbye', -1)).toEqual('ERROR');
1818
});
1919
test.skip('repeats the string a random amount of times', function () {
2020
/*The number is generated by using Math.random to get a value from between
@@ -29,7 +29,7 @@ describe('repeatString', () => {
2929
/*The .match(/((hey))/g).length is a regex that will count the number of heys
3030
in the result, which if your function works correctly will equal the number that
3131
was randomly generated. */
32-
expect(repeatString('hey', number).match(/(hey)/g).length).toEqual(number);
32+
expect(repeatString('odin', number).match(/((odin))/g).length).toEqual(number);
3333
});
3434
test.skip('works with blank strings', () => {
3535
expect(repeatString('', 10)).toEqual('');

02_repeatString/solution/repeatString-solution.spec.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ describe('repeatString', () => {
55
expect(repeatString('hey', 3)).toEqual('heyheyhey');
66
});
77
test('repeats the string many times', () => {
8-
expect(repeatString('hey', 10)).toEqual('heyheyheyheyheyheyheyheyheyhey');
8+
expect(repeatString('hello', 10)).toEqual('hellohellohellohellohellohellohellohellohellohello');
99
});
1010
test('repeats the string 1 times', () => {
11-
expect(repeatString('hey', 1)).toEqual('hey');
11+
expect(repeatString('hi', 1)).toEqual('hi');
1212
});
1313
test('repeats the string 0 times', () => {
14-
expect(repeatString('hey', 0)).toEqual('');
14+
expect(repeatString('bye', 0)).toEqual('');
1515
});
1616
test('returns ERROR with negative numbers', () => {
17-
expect(repeatString('hey', -1)).toEqual('ERROR');
17+
expect(repeatString('goodbye', -1)).toEqual('ERROR');
1818
});
1919
test('repeats the string a random amount of times', function () {
2020
/*The number is generated by using Math.random to get a value from between
@@ -29,7 +29,7 @@ describe('repeatString', () => {
2929
/*The .match(/((hey))/g).length is a regex that will count the number of heys
3030
in the result, which if your function works correctly will equal the number that
3131
was randomly generated. */
32-
expect(repeatString('hey', number).match(/(hey)/g).length).toEqual(
32+
expect(repeatString('odin', number).match(/((odin))/g).length).toEqual(
3333
number
3434
);
3535
});

0 commit comments

Comments
 (0)