Created
March 20, 2020 15:06
-
-
Save Pholisa-Fatyela/c9a52d7667fd6c2bff654d2a7473c35b to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/weqakip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/mocha/3.2.0/mocha.css"> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/3.2.0/mocha.js" charset="utf-8"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/chai/3.5.0/chai.min.js"></script> | |
<div id="mocha"></div> | |
<script> | |
// the mocha test style to use - we use BDD - Behviour Driven Development | |
mocha.setup('bdd'); | |
//ensure the assert function is available | |
var assert = chai.assert; | |
</script> | |
<script id="jsbin-javascript"> | |
// fix this function to make the unit tests pass below | |
function greet(name) { | |
// write your code here | |
return "Hello, " + name; | |
// write your code above this line | |
} | |
// don't change any code below this line | |
describe("Greet is working fine", function() { | |
it("should be able to greet Lindani", function() { | |
assert.equal("Hello, Lindani", greet("Lindani")); | |
}); | |
it("should be able to greet Siyanda", function() { | |
assert.equal("Hello, Siyanda", greet("Siyanda")); | |
}); | |
}); | |
mocha.checkLeaks(); | |
mocha.run(); | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript"> // fix this function to make the unit tests pass below | |
function greet(name) { | |
// write your code here | |
return "Hello, " + name; | |
// write your code above this line | |
} | |
// don't change any code below this line | |
describe("Greet is working fine", function() { | |
it("should be able to greet Lindani", function() { | |
assert.equal("Hello, Lindani", greet("Lindani")); | |
}); | |
it("should be able to greet Siyanda", function() { | |
assert.equal("Hello, Siyanda", greet("Siyanda")); | |
}); | |
}); | |
mocha.checkLeaks(); | |
mocha.run();</script></body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// fix this function to make the unit tests pass below | |
function greet(name) { | |
// write your code here | |
return "Hello, " + name; | |
// write your code above this line | |
} | |
// don't change any code below this line | |
describe("Greet is working fine", function() { | |
it("should be able to greet Lindani", function() { | |
assert.equal("Hello, Lindani", greet("Lindani")); | |
}); | |
it("should be able to greet Siyanda", function() { | |
assert.equal("Hello, Siyanda", greet("Siyanda")); | |
}); | |
}); | |
mocha.checkLeaks(); | |
mocha.run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment