Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.