Skip to content

Instantly share code, notes, and snippets.

@Loreen-netizen
Created March 20, 2020 14:32
Show Gist options
  • Save Loreen-netizen/d5eab8998952d07f354dd7f7d4d30809 to your computer and use it in GitHub Desktop.
Save Loreen-netizen/d5eab8998952d07f354dd7f7d4d30809 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/bibihis
<!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>
// 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