Skip to content

Commit cd5ac2d

Browse files
committed
chore: add e2e test
1 parent 3e686ff commit cd5ac2d

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

cypress/integration/middleware/standard.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,11 @@ describe('Middleware matchers', () => {
4343
})
4444
})
4545
})
46+
47+
describe('Middleware with edge API', () => {
48+
it('serves API routes from the edge runtime', () => {
49+
cy.request('/api/edge').then((response) => {
50+
expect(response.body).to.include('Hello world')
51+
})
52+
})
53+
})

demos/middleware/pages/api/edge.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export const config = {
2+
runtime: 'experimental-edge',
3+
}
4+
5+
export default (req) => new Response('Hello world!')

0 commit comments

Comments
 (0)