mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
## What? Converts existing `createNext()` usage into `nextTestSetup()`. `createNext()` was the setup step we had before `nextTestSetup()` was added. This PR focused on the simple conversion cases. There will be a follow-up to complete the last few. --------- Co-authored-by: Cursor <[email protected]>
33 lines
787 B
TypeScript
33 lines
787 B
TypeScript
import { nextTestSetup } from 'e2e-utils'
|
|
import { renderViaHTTP } from 'next-test-utils'
|
|
|
|
describe('browserslist-extends', () => {
|
|
const { next } = nextTestSetup({
|
|
files: {
|
|
'pages/index.js': `
|
|
import styles from './index.module.css'
|
|
|
|
export default function Page() {
|
|
return <p className={styles.hello}>hello world</p>
|
|
}
|
|
`,
|
|
'pages/index.module.css': `
|
|
.hello {
|
|
color: pink;
|
|
}
|
|
`,
|
|
},
|
|
dependencies: {
|
|
'browserslist-config-google': '^3.0.1',
|
|
},
|
|
packageJson: {
|
|
browserslist: ['extends browserslist-config-google'],
|
|
},
|
|
})
|
|
|
|
it('should work', async () => {
|
|
const html = await renderViaHTTP(next.url, '/')
|
|
expect(html).toContain('hello world')
|
|
})
|
|
})
|