Files
Jiachi LiuandGitHub 48093b87a9 Allow jest to run with use server directive (#56148)
Disable server components and server actions SWC transform when it's running jest. You can only do basic DOM testing like what we described in #54891 instead the server action itself.

Closes #53065 
Closes NEXT-1473
2023-09-28 14:15:51 +00:00

11 lines
243 B
React

/**
* @jest-environment jsdom
*/
import { render, screen } from '@testing-library/react'
import Page from './page'
it('works with client-only code', () => {
render(<Page />)
expect(screen.getByTestId('log')).toHaveTextContent('log')
})