Buckets:
| /** | |
| * @jest-environment jsdom | |
| */ | |
| import { act, render } from '@testing-library/react' | |
| import '@testing-library/jest-dom' | |
| import Link from 'next/link' | |
| import React from 'react' | |
| describe('<Link/>', () => { | |
| let spy | |
| let expectedErrors | |
| beforeAll(async () => { | |
| spy = jest.spyOn(console, 'error').mockImplementation((...args) => { | |
| console.log(...args) | |
| }) | |
| expectedErrors = 0 | |
| }) | |
| it('test link with unmount', () => { | |
| act(() => { | |
| const { unmount } = render(<Link href="/">hello</Link>) | |
| unmount() | |
| }) | |
| expect(spy).toHaveBeenCalledTimes(expectedErrors) | |
| }) | |
| it('test link without unmount', () => { | |
| act(() => { | |
| render(<Link href="/">hello</Link>) | |
| }) | |
| expect(spy).toHaveBeenCalledTimes(expectedErrors) | |
| }) | |
| afterAll(() => { | |
| spy.mockRestore() | |
| }) | |
| }) | |
Xet Storage Details
- Size:
- 819 Bytes
- Xet hash:
- 719a9c08adef39c492af77dc58f6948885eb94fecfcb0d26bb74da9561da6290
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.