Created
February 23, 2012 16:24
-
-
Save laribee/1893524 to your computer and use it in GitHub Desktop.
browser testing w/o a browser w/ coffeescript, jsdom and mocha
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
| harness = require('../test_harness') | |
| expect = harness.expect | |
| HtmlEncoder = harness.load('HtmlEncoder') | |
| describe "Escaping html w/ coffee", -> | |
| it "escapes simple P tag", (inform_mocha_we_are_done) -> | |
| harness.testInBrowser inform_mocha_we_are_done, (window) -> | |
| text = '<p>hello</p>' | |
| encoded = HtmlEncoder.encode(window, text) | |
| expect(encoded).to.equal('<p>hello</p>') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment