From 53b01bcab20a8c39a8bbbe5cafe2c1cc3ab3812e Mon Sep 17 00:00:00 2001 From: Jeremy Elbourn Date: Mon, 25 Feb 2019 13:55:55 -0800 Subject: [PATCH] test(grid-list): make error expectation less brittle (#15303) This makes the test pass in ivy (as well as ViewEngine) since attribute bindings are set during creating mode in ivy. --- src/lib/grid-list/grid-list.spec.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/grid-list/grid-list.spec.ts b/src/lib/grid-list/grid-list.spec.ts index 026c0252723..f92a433830e 100644 --- a/src/lib/grid-list/grid-list.spec.ts +++ b/src/lib/grid-list/grid-list.spec.ts @@ -23,9 +23,10 @@ describe('MatGridList', () => { }); it('should throw error if rowHeight ratio is invalid', () => { - const fixture = createComponent(GridListWithInvalidRowHeightRatio); - - expect(() => fixture.detectChanges()).toThrowError(/invalid ratio given for row-height/); + expect(() => { + const fixture = createComponent(GridListWithInvalidRowHeightRatio); + fixture.detectChanges(); + }).toThrowError(/invalid ratio given for row-height/); }); it('should throw error if tile colspan is wider than total cols', () => {