Skip to content
Open

Done #7444

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
function shout(string) {
return string.toUpperCase()
}

function whisper(string) {
return string.toLowerCase()
}

//describe('whisper(string)', function() {
// it('receives one argument and returns it in all lowercase', function() {
// expect(whisper('HELLO')).toEqual('hello')
// })
//})
//
//describe('logShout(string)', function() {
// it('takes a string argument and logs it in all caps using console.log()', function() {
// const spy = expect.spyOn(console, 'log').andCallThrough()
//
// logShout('hello')
//
// expect(spy).toHaveBeenCalledWith('HELLO')
//
// console.log.restore()
// })
//})

function logShout(string) {
console.log(shout(string))
}

function logWhisper(string) {
console.log(whisper(string))
}

//describe('sayHiToGrandma(string)', function() {
// it('returns "I can\'t hear you!" if `string` is lowercase', function() {
// expect(sayHiToGrandma('hello')).toEqual("I can't hear you!")
// })

// it('returns "YES INDEED!" if `string` is uppercase', function() {
// expect(sayHiToGrandma('HELLO')).toEqual("YES INDEED!")
// })

// it('returns "I love you, too." if `string` is "I love you, Grandma."`', function() {
// expect(sayHiToGrandma("I love you, Grandma.")).toEqual("I love you, too.")
// })
// })

function sayHiToGrandma(string) {
var result;

if (string == 'hello') {
result = "I can't hear you!"
}

if (string == 'HELLO') {
result = "YES INDEED!"
}

if (string == 'I love you, Grandma.') {
result = "I love you, too."
}
return result
}