Skip to content

Commit

Permalink
test: [bootstrap] normalize boostrap across all test scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
logicalparadox committed Feb 3, 2013
1 parent 163c3c6 commit 364939e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion test/bootstrap/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ global.err = function (fn, msg) {
fn();
throw new chai.AssertionError({ message: 'Expected an error' });
} catch (err) {
chai.expect(err.message).to.equal(msg);
if ('string' === typeof msg) {
chai.expect(err.message).to.equal(msg);
} else {
chai.expect(err.message).to.match(msg);
}
}
};
6 changes: 5 additions & 1 deletion test/browser/component.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
fn();
throw new chai.AssertionError({ message: 'Expected an error' });
} catch (err) {
chai.expect(err.message).to.equal(msg);
if ('string' === typeof msg) {
chai.expect(err.message).to.equal(msg);
} else {
chai.expect(err.message).to.match(msg);
}
}
};
</script>
Expand Down
6 changes: 5 additions & 1 deletion test/browser/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
fn();
throw new chai.AssertionError({ message: 'Expected an error' });
} catch (err) {
chai.expect(err.message).to.equal(msg);
if ('string' === typeof msg) {
chai.expect(err.message).to.equal(msg);
} else {
chai.expect(err.message).to.match(msg);
}
}
};
</script>
Expand Down

0 comments on commit 364939e

Please sign in to comment.