test(link): add testcase for deprecate warning

This commit is contained in:
unix
2020-05-08 16:58:51 +08:00
parent 495cc55e05
commit 909cee6ae1

View File

@@ -41,5 +41,13 @@ describe('Link', () => {
expect(errorSpy).not.toHaveBeenCalled()
expect(ref.current).not.toBeNull()
expect(() => wrapper.unmount()).not.toThrow()
errorSpy.mockRestore()
})
it('an warning should be thrown when using the pure prop', () => {
const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {})
mount(<Link pure />)
expect(errorSpy).toHaveBeenCalled()
errorSpy.mockRestore()
})
})