Skip to content

Commit 2723b5c

Browse files
committed
fixed test coverage
1 parent 29bf28f commit 2723b5c

File tree

1 file changed

+10
-0
lines changed
  • packages/event-handler/tests/unit/rest/middleware

1 file changed

+10
-0
lines changed

packages/event-handler/tests/unit/rest/middleware/cors.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@ describe('CORS Middleware', () => {
126126
it('does not set CORS headers when preflight request method does not match allowed method', async () => {
127127
// Prepare
128128
const app = new Router();
129+
app.use(
130+
cors({
131+
allowMethods: ['POST'],
132+
})
133+
);
129134

130135
// Act
131136
const result = await app.resolve(
@@ -143,6 +148,11 @@ describe('CORS Middleware', () => {
143148
it('does not set CORS headers when preflight request header does not match allowed header', async () => {
144149
// Prepare
145150
const app = new Router();
151+
app.use(
152+
cors({
153+
allowHeaders: ['Content-Type'],
154+
})
155+
);
146156

147157
// Act
148158
const result = await app.resolve(

0 commit comments

Comments
 (0)