move files from testing repo to this repo

This commit is contained in:
Michael Frank
2021-04-30 21:49:46 +12:00
parent fb304675d8
commit 35d7948aa2
17 changed files with 624 additions and 583 deletions
+9 -9
View File
@@ -1,22 +1,22 @@
const expect = require('expect');const repeatString = require('./repeatString')
const repeatString = require('./repeatString')
describe('repeatString', function() {
it('repeats the string', function() {
describe('repeatString', () => {
test('repeats the string', () => {
expect(repeatString('hey', 3)).toEqual('heyheyhey');
});
xit('repeats the string many times', function() {
test.skip('repeats the string many times', () => {
expect(repeatString('hey', 10)).toEqual('heyheyheyheyheyheyheyheyheyhey');
});
xit('repeats the string 1 times', function() {
test.skip('repeats the string 1 times', () => {
expect(repeatString('hey', 1)).toEqual('hey');
});
xit('repeats the string 0 times', function() {
test.skip('repeats the string 0 times', () => {
expect(repeatString('hey', 0)).toEqual('');
});
xit('returns ERROR with negative numbers', function() {
test.skip('returns ERROR with negative numbers', () => {
expect(repeatString('hey', -1)).toEqual('ERROR');
});
xit('repeats the string a random amount of times', function () {
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
0 to 1, when this is multiplied by 1000 and rounded down with Math.floor it
equals a number between 0 to 999 (this number will change everytime you run
@@ -31,7 +31,7 @@ describe('repeatString', function() {
was randomaly generated. */
expect(repeatString('hey', number).match(/((hey))/g).length).toEqual(number);
});
xit('works with blank strings', function() {
test.skip('works with blank strings', () => {
expect(repeatString('', 10)).toEqual('');
});
});