rsnext/test/e2e/app-dir/dynamic-requests/dynamic-requests.test.ts
Tobias Koppers b4b757c25d
ignore fully dynamic requests on server side (#62949)
### What?

make sure that we don't error for dynamic requests on server side.

It will throw at runtime when using a dynamic request.

### Why?

Not all packages are fully bundler compatible, but still work when only
using the parts that work. We don't want to block users from using them
by having an hard compile error.

### How?


Closes PACK-2675
2024-03-11 08:41:33 +00:00

18 lines
499 B
TypeScript

import { nextTestSetup } from 'e2e-utils'
describe('dynamic-requests', () => {
const { next } = nextTestSetup({
files: __dirname,
})
it('should not error for dynamic requests in pages', async () => {
const $ = await next.render$('/')
expect($('p').text()).toBe('Hello World')
})
it('should not error for dynamic requests in routes', async () => {
const res = await next.fetch('/hello')
const html = await res.text()
expect(html).toContain('Hello World')
})
})