Use jest's expectation matchers if possible

@Tirokk jest has a lot of assertion matchers that will give you better
error messages than the default ones:
https://jestjs.io/docs/en/expect.html#tohavelengthnumber
This commit is contained in:
Robert Schäfer 2019-06-07 16:53:30 +02:00
parent a978591843
commit 9384f85ebf

View File

@ -66,7 +66,7 @@ describe('ProfileSlug', () => {
beforeEach(jest.runAllTimers)
it('emits "deletePost"', () => {
expect(wrapper.emitted().deletePost.length).toBe(1)
expect(wrapper.emitted().deletePost).toHaveLength(1)
})
it('does not go to index (main) page', () => {