Assert the new improved error message

This commit is contained in:
Kimmo Puputti 2017-10-16 14:36:31 +03:00
parent d56195b417
commit 72f8d713bc

View file

@ -22,14 +22,14 @@ describe('util/routes.js', () => {
createResourceLocatorString('ListingPage', routes, { id: '1234', slug: 'nice-listing' }, {})
).toEqual('/l/nice-listing/1234');
expect(() => createResourceLocatorString('ListingPage', routes, {}, {})).toThrowError(
TypeError('Expected "slug" to be defined')
TypeError('Expected "slug" to be a string')
);
expect(() =>
createResourceLocatorString('ListingPage', routes, { id: '1234' }, {})
).toThrowError(TypeError('Expected "slug" to be defined'));
).toThrowError(TypeError('Expected "slug" to be a string'));
expect(() =>
createResourceLocatorString('ListingPage', routes, { slug: 'nice-listing' }, {})
).toThrowError(TypeError('Expected "id" to be defined'));
).toThrowError(TypeError('Expected "id" to be a string'));
});
it('should return meaningful strings with search parameters', () => {