karma-jasmine-diff-reporter
Version:
Diff and pretty print for failed tests
27 lines (19 loc) • 507 B
JavaScript
describe('Matcher', function () {
describe('toThrow', function () {
it('should diff', function () {
var foo = function () {
// eslint-disable-next-line no-undef
return a + 1;
};
expect(foo).toThrow(new TypeError('boo'));
});
});
describe('toThrowError', function () {
it('should diff', function () {
var foo = function () {
throw new ReferenceError('foo');
};
expect(foo).toThrowError(TypeError, 'boo');
});
});
});