Skip to content

Commit ccfc06d

Browse files
committed
test: move tests for request headers into standard
1 parent 5355a44 commit ccfc06d

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

cypress/integration/middleware/enhanced.spec.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
11
describe('Enhanced middleware', () => {
2-
it('adds request headers', () => {
3-
cy.request('/api/hello').then((response) => {
4-
expect(response.body).to.have.nested.property('headers.x-hello', 'world')
5-
})
6-
})
7-
8-
it('adds request headers to a rewrite', () => {
9-
cy.request('/headers').then((response) => {
10-
expect(response.body).to.have.nested.property('headers.x-hello', 'world')
11-
})
12-
})
13-
142
it('rewrites the response body', () => {
153
cy.visit('/static')
164
cy.get('#message').contains('This was static but has been transformed in')

cypress/integration/middleware/standard.spec.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
describe('Standard middleware', () => {
2+
it('adds request headers', () => {
3+
cy.request('/api/hello').then((response) => {
4+
expect(response.body).to.have.nested.property('headers.x-hello', 'world')
5+
})
6+
})
7+
8+
it('adds request headers to a rewrite', () => {
9+
cy.request('/headers').then((response) => {
10+
expect(response.body).to.have.nested.property('headers.x-hello', 'world')
11+
})
12+
})
13+
214
it('rewrites to internal page', () => {
315
// preview mode is off by default
416
cy.visit('/shows/rewriteme')

0 commit comments

Comments
 (0)