Skip to content

Commit

Permalink
Add comments to test html file
Browse files Browse the repository at this point in the history
  • Loading branch information
okcoker committed Feb 5, 2015
1 parent ea69519 commit f4b206c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.DS_Store

# Logs
logs
*.log
Expand Down
22 changes: 15 additions & 7 deletions test/index.html
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>

0 comments on commit f4b206c

Please sign in to comment.