From ee8204f99d932ff42231844b1da622e53e925d8f Mon Sep 17 00:00:00 2001 From: othmane Date: Sat, 16 Feb 2019 21:50:47 +0100 Subject: [PATCH] Complete the helloWorld,repeatString and reverseString exercices with jasmine tests --- helloWorld/helloWorld.js | 2 +- repeatString/repeatString.js | 14 +++++++++++--- repeatString/repeatString.spec.js | 8 ++++---- reverseString/reverseString.js | 14 ++++++++++++-- reverseString/reverseString.spec.js | 2 +- spec/support/jasmine.json | 11 +++++++++++ 6 files changed, 40 insertions(+), 11 deletions(-) create mode 100644 spec/support/jasmine.json diff --git a/helloWorld/helloWorld.js b/helloWorld/helloWorld.js index a41264d..7d01115 100644 --- a/helloWorld/helloWorld.js +++ b/helloWorld/helloWorld.js @@ -1,5 +1,5 @@ const helloWorld = function() { - return '' + return 'Hello, World!' } module.exports = helloWorld diff --git a/repeatString/repeatString.js b/repeatString/repeatString.js index 770119a..58a1295 100644 --- a/repeatString/repeatString.js +++ b/repeatString/repeatString.js @@ -1,5 +1,13 @@ -const repeatString = function() { - -} +const repeatString = function(repeat,j) { + if (j<0){ + return 'ERROR'; + }else{ + var str = ''; + for (var i=0; i