Skip to content

Commit 1d2048b

Browse files
committed
update test
1 parent e628cbd commit 1d2048b

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

test/e2e/app-dir/app-root-params-getters/simple.test.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,18 +124,13 @@ describe('app-root-param-getters - simple', () => {
124124
}
125125
})
126126

127-
// TODO(root-params): add support for route handlers
128-
it('should error when used in a route handler (until we implement it)', async () => {
127+
it('should allow reading params in a route handler', async () => {
129128
const params = { lang: 'en', locale: 'us' }
130129
const response = await next.fetch(
131130
`/${params.lang}/${params.locale}/route-handler`
132131
)
133-
expect(response.status).toBe(500)
134-
if (!isNextDeploy) {
135-
expect(next.cliOutput).toInclude(
136-
"Route /[lang]/[locale]/route-handler used `import('next/root-params').lang()` inside a Route Handler. Support for this API in Route Handlers is planned for a future version of Next.js."
137-
)
138-
}
132+
expect(response.status).toBe(200)
133+
expect(await response.json()).toEqual(params)
139134
})
140135
})
141136

0 commit comments

Comments
 (0)