Last active
December 18, 2015 13:39
-
-
Save zakuni/5791841 to your computer and use it in GitHub Desktop.
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
| define () -> | |
| class Camera | |
| take: -> | |
| # do nothing |
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
| define ['camera', 'mocha', 'chai'], (Camera, mocha, chai) -> | |
| assert = chai.assert | |
| suite 'Camera', () -> | |
| camera = new Camera() | |
| suite '#Camera', () -> | |
| test 'is instance of Camera', () -> | |
| assert.instanceOf(camera, Camera) | |
| suite '#take()', () -> | |
| test 'is function', () -> | |
| assert.isFunction(camera.take) |
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
| requirejs.config | |
| paths: | |
| mocha: '../components/mocha/mocha' | |
| chai: '../components/chai/chai' | |
| camera: '../camera' | |
| shim: | |
| 'mocha': | |
| init: () -> | |
| this.mocha.setup('tdd') | |
| return this.mocha | |
| require ['camera', 'mocha', 'chai', 'test.camera'], (Camera) -> | |
| mocha.run() |
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> | |
| <meta charset="utf-8"> | |
| <title>Mocha Tests</title> | |
| <link rel="stylesheet" href="../components/mocha/mocha.css" /> | |
| </head> | |
| <body> | |
| <div id="mocha"></div> | |
| <script src="../components/chai/chai.js"></script> | |
| <script src="../components/mocha/mocha.js"></script> | |
| <script src="../components/requirejs/require.js" data-main="test"></script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment