Skip to content

Instantly share code, notes, and snippets.

@pifantastic
Created February 5, 2014 11:53
Show Gist options
  • Save pifantastic/8822073 to your computer and use it in GitHub Desktop.
Save pifantastic/8822073 to your computer and use it in GitHub Desktop.
define([
'fixtures'
], function (fixtures) {
describe('Some unit tests', function () {
before(function () {
/**
* Will add the following HTML to the DOM before running the following tests:
*
* <form>
* <input type="text" class="search">
* </form>
*/
fixtures.add('form>input.search[type="text"][value="foo"]');
});
after(function () {
// Clears previously created fixtures.
fixtures.clear();
});
it('should do something', function () {
// Use the .find() method just like jQuery's find() method to get
// fixture elements.
var input = fixtures.find('input.search');
expect(input.val()).to.equal('foo');
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment