Testing Chai JS 'be" without chai-jquery
HTML
<link rel="stylesheet" href="https://s3.amazonaws.com/kiddsoftware-jsfiddle/mocha-1.9.0.css">
<script src="https://s3.amazonaws.com/kiddsoftware-jsfiddle/mocha-1.9.0.js"></script>
<script src="https://s3.amazonaws.com/kiddsoftware-jsfiddle/sinon-1.6.0.js"></script>
<script src=" https://s3.amazonaws.com/kiddsoftware-jsfiddle/chai-1.5.0.js"></script>
<!-- Mocha test output goes here. -->
<div id="mocha"></div>
JavaScript
// Configure Mocha, telling both it and chai to use BDD-style tests.
mocha.setup("tdd");
var assert = chai.assert;
chai.should();
describe('testing be word', function () {
var answer = 42;
if("should check answer", function() {
should.not.exist(answer);
});
it('assertion', function () {
assert.equal(1 + 1 + 1, 3);
});
});
// Run all our test suites. Only necessary in the browser.
mocha.run();