rsnext/test/e2e/app-dir/app-alias.test.ts
Josh Story cee656238a
Fix latest experimental react and experimental-edge and unpin test versions (#41200)
This ensures we don't stub `react-dom` with the `experimental-edge` runtime and also unpins our tests to use the latest experimental release. 

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-10-05 21:27:47 +00:00

37 lines
1,016 B
TypeScript

import { createNext, FileRef } from 'e2e-utils'
import { NextInstance } from 'test/lib/next-modes/base'
import { renderViaHTTP } from 'next-test-utils'
import path from 'path'
describe('app-dir alias handling', () => {
if ((global as any).isNextDeploy) {
it('should skip next deploy for now', () => {})
return
}
if (process.env.NEXT_TEST_REACT_VERSION === '^17') {
it('should skip for react v17', () => {})
return
}
let next: NextInstance
beforeAll(async () => {
next = await createNext({
files: new FileRef(path.join(__dirname, 'app-alias')),
dependencies: {
react: 'experimental',
'react-dom': 'experimental',
typescript: 'latest',
'@types/react': 'latest',
'@types/node': 'latest',
},
})
})
afterAll(() => next.destroy())
it('should handle typescript paths alias correctly', async () => {
const html = await renderViaHTTP(next.url, '/button')
expect(html).toContain('<button>click</button>')
})
})