-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
17 additions
and
7 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.DS_Store | ||
|
||
# Logs | ||
logs | ||
*.log | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,42 @@ | ||
<!-- Mocha tests in the browser use unicode symbols for bullet points | ||
so unless you want weird character bullet points, we add this. It doesn't | ||
break anything with or without it. --> | ||
<meta charset="utf-8"> | ||
|
||
<link rel="stylesheet" href="../node_modules/grunt-blanket-mocha/node_modules/mocha/mocha.css"> | ||
|
||
<!-- This is where mocha inserts the test results that are styled with the css file above --> | ||
<div id="mocha"></div> | ||
|
||
<!-- This is where any fixtures we need for the test will be inserted into. Naturally, we won't want to cover the mocha test results so we position this bad boy off screen. --> | ||
<div id="test" style="position: fixed; top: 0; left: -99999px;"> | ||
</div> | ||
|
||
<!-- Test Libraries --> | ||
<!-- We need to insert our testing dependencies here --> | ||
<script src="../node_modules/chai/chai.js"></script> | ||
<script src="../node_modules/sinon-chai/lib/sinon-chai.js"></script> | ||
<script src="../node_modules/sinon/pkg/sinon.js"></script> | ||
<script src="../node_modules/grunt-blanket-mocha/node_modules/mocha/mocha.js"></script> | ||
<script src="../node_modules/grunt-blanket-mocha/node_modules/blanket/dist/mocha/blanket_mocha.js"></script> | ||
<script src="../node_modules/grunt-blanket-mocha/support/mocha-blanket.js"></script> | ||
|
||
<!-- We will using BDD-style assertions. See mocha documentation if you want more info about this line --> | ||
<script>mocha.setup('bdd');</script> | ||
|
||
<!-- Modules --> | ||
<!-- The source file we will be testing! --> | ||
<script src="../js/calculator.js" data-cover></script> | ||
|
||
<!-- Suites --> | ||
<!-- Our test suite needs to be after the source file, of course --> | ||
<script src="calculator-test.js"></script> | ||
|
||
<script> | ||
// For blanket add coverage in our mocha CLI tests (node environment), | ||
// we need to add this reporter | ||
if (window.PHANTOMJS) { | ||
blanket.options("reporter", "../node_modules/grunt-blanket-mocha/support/grunt-reporter.js"); | ||
} | ||
if (window.mochaPhantomJS) { | ||
window.mochaPhantomJS.run(); | ||
} | ||
else if (!window.PHANTOMJS) { | ||
// If we're in in the browser | ||
else { | ||
mocha.run(); | ||
} | ||
</script> |