Created
March 20, 2020 15:10
-
-
Save Pholisa-Fatyela/1274bca4444adee61b276b620961ecbf to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/pufisen
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"> | |
// don't change the isFromBellville function | |
function isFromBellville(regNumber) { | |
return regNumber.startsWith("CY"); | |
} | |
describe("The isFromBellville function ", function() { | |
// don't change code above this line | |
it("should return true for CY 123-223", function() { | |
assert.equal(true, isFromBellville("CY 123-223")); | |
}); | |
it("should return false for CY 123-223", function() { | |
assert.equal(false, isFromBellville("CJ 123-223")); | |
}); | |
// don't change code below this line | |
}); | |
mocha.checkLeaks(); | |
mocha.run(); | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">// don't change the isFromBellville function | |
function isFromBellville(regNumber) { | |
return regNumber.startsWith("CY"); | |
} | |
describe("The isFromBellville function ", function() { | |
// don't change code above this line | |
it("should return true for CY 123-223", function() { | |
assert.equal(true, isFromBellville("CY 123-223")); | |
}); | |
it("should return false for CY 123-223", function() { | |
assert.equal(false, isFromBellville("CJ 123-223")); | |
}); | |
// don't change code below this line | |
}); | |
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
// don't change the isFromBellville function | |
function isFromBellville(regNumber) { | |
return regNumber.startsWith("CY"); | |
} | |
describe("The isFromBellville function ", function() { | |
// don't change code above this line | |
it("should return true for CY 123-223", function() { | |
assert.equal(true, isFromBellville("CY 123-223")); | |
}); | |
it("should return false for CY 123-223", function() { | |
assert.equal(false, isFromBellville("CJ 123-223")); | |
}); | |
// don't change code below this line | |
}); | |
mocha.checkLeaks(); | |
mocha.run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment