Skip to content

Commit

Permalink
fix(test): toHaveSize is now also a jasmine core matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
tomyam1 committed Oct 3, 2020
1 parent ddc712d commit 22d381e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/matchers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('matchers', () => {
'toBeChecked',
'toBeSelected',
'toHaveWidth',
'toHaveSize',
//'toHaveSize',
// 'toHaveClass',
'toBeNearLocation',
'toHaveCssValue',
Expand All @@ -56,12 +56,19 @@ describe('matchers', () => {
});
}

it('should override the jasmin\'s default toHaveClass', () => {
it(`should override the jasmin's default toHaveClass`, () => {
const orig = expect({}).toHaveClass;
expect(expect({}).toHaveClass).toBe(orig);
jasmine.addMatchers(matchers);
expect(expect({}).toHaveClass).not.toBe(orig);
});

it(`should override the jasmin's default toHaveSize`, () => {
const orig = expect({}).toHaveSize;
expect(expect({}).toHaveSize).toBe(orig);
jasmine.addMatchers(matchers);
expect(expect({}).toHaveSize).not.toBe(orig);
});
});

describe('toBePresent()', () => {
Expand Down

0 comments on commit 22d381e

Please sign in to comment.