mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +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]>
20 lines
554 B
TypeScript
20 lines
554 B
TypeScript
import { join } from 'path'
|
|
import { FileRef, nextTestSetup } from 'e2e-utils'
|
|
import { fetchViaHTTP } from 'next-test-utils'
|
|
|
|
describe('trailingSlash:true with rewrites and getStaticProps', () => {
|
|
if ((global as any).isNextDeploy) {
|
|
it('should skip for deploy mode for now', () => {})
|
|
return
|
|
}
|
|
|
|
const { next } = nextTestSetup({
|
|
files: new FileRef(join(__dirname, './app')),
|
|
})
|
|
|
|
it('should work', async () => {
|
|
const res = await fetchViaHTTP(next.url, '/country')
|
|
expect(await res.text()).toContain('Welcome home')
|
|
})
|
|
})
|