Skip to content

Instantly share code, notes, and snippets.

@code0100fun
Created March 30, 2015 13:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save code0100fun/6f87155564ccf3724749 to your computer and use it in GitHub Desktop.
Save code0100fun/6f87155564ccf3724749 to your computer and use it in GitHub Desktop.
Using custom QUnit assertions with Ember CLI
// tests/test-helper.js
import QUnit from 'qunit';
QUnit.assert.trimEq = function(actual, expected) {
var trimActual = actual.replace(/^\s+|\s+$/g,'');
this.equal(trimActual, expected);
};
// tests/unit/components/*.js
assert.trimEq(this.$().text(), 'foo');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment