Skip to content

Commit

Permalink
add no react test
Browse files Browse the repository at this point in the history
  • Loading branch information
devjiwonchoi committed Aug 15, 2024
1 parent 8ef8985 commit e3b574f
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/e2e/app-dir/no-react/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { ReactNode } from 'react'
export default function Root({ children }: { children: ReactNode }) {
return (
<html>
<body>{children}</body>
</html>
)
}
3 changes: 3 additions & 0 deletions test/e2e/app-dir/no-react/app/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function Page() {
return <p>hello world</p>
}
6 changes: 6 additions & 0 deletions test/e2e/app-dir/no-react/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* @type {import('next').NextConfig}
*/
const nextConfig = {}

module.exports = nextConfig
13 changes: 13 additions & 0 deletions test/e2e/app-dir/no-react/no-react.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { nextTestSetup } from 'e2e-utils'

describe('no-react', () => {
const { next } = nextTestSetup({
files: __dirname,
installCommand: 'pnpm remove react react-dom',
})

it('should work using cheerio without react, react-dom', async () => {
const $ = await next.render$('/')
expect($('p').text()).toBe('hello world')
})
})

0 comments on commit e3b574f

Please sign in to comment.