mirror of
https://github.com/10h30/odin-javascript-exercises.git
synced 2026-06-05 15:09:09 +09:00
move files from testing repo to this repo
This commit is contained in:
@@ -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('');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user