mirror of
https://github.com/zhigang1992/react.git
synced 2026-03-26 06:55:07 +08:00
test(link): add testcase for deprecate warning
This commit is contained in:
@@ -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()
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user