Last active
December 19, 2015 09:49
-
-
Save andyperlitch/5935527 to your computer and use it in GitHub Desktop.
Testing setup with Blanket.js coverage for Browserify
This file contains hidden or 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
| browserify test/test.bundle.entry.js > test.bundle.js |
This file contains hidden or 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
| // Entry point for test bundle. | |
| // All of these spec files get | |
| // bundled into test.bundle.js | |
| require('../path/to/spec1'); | |
| require('../path/to/spec2'); | |
| require('../path/to/spec3'); |
This file contains hidden or 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
| <html> | |
| <head> | |
| <title>Test Runner</title> | |
| <link rel="stylesheet" href="../node_modules/mocha/mocha.css" type="text/css" media="screen" charset="utf-8"> | |
| </head> | |
| <body> | |
| <div id="mocha"></div> | |
| <script src="../js/vendor/jquery/dist/jquery.js"></script> | |
| <script src="../node_modules/mocha/mocha.js" type="text/javascript" charset="utf-8"></script> | |
| <script src="../node_modules/chai/chai.js" type="text/javascript" charset="utf-8"></script> | |
| <script> | |
| mocha.setup('bdd'); | |
| expect = chai.expect; | |
| </script> | |
| <script src="blanket.js" data-cover-flags="debug"></script> | |
| <script src="mocha.adaptor.js"></script> | |
| <script src="test.bundle.js" data-cover></script> | |
| <script> | |
| mocha.globals([ 'script*' ]).run(); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment