1
1
import { Headers } from '@whatwg-node/fetch'
2
2
import type { APIGatewayProxyEvent } from 'aws-lambda'
3
- import { test , expect } from 'vitest'
3
+ import { test , expect , describe } from 'vitest'
4
4
5
5
import { normalizeRequest } from '../transforms'
6
6
@@ -55,7 +55,7 @@ export const createMockedLambdaEvent = (
55
55
}
56
56
57
57
describe ( 'Lambda Request' , ( ) => {
58
- it ( 'Normalizes an aws event with base64' , async ( ) => {
58
+ test ( 'Normalizes an aws event with base64' , async ( ) => {
59
59
const corsEventB64 = createMockedLambdaEvent (
60
60
'POST' ,
61
61
Buffer . from ( JSON . stringify ( { bazinga : 'hello_world' } ) , 'utf8' ) . toString (
@@ -74,7 +74,7 @@ describe('Lambda Request', () => {
74
74
} )
75
75
} )
76
76
77
- it ( 'Handles CORS requests with and without b64 encoded' , async ( ) => {
77
+ test ( 'Handles CORS requests with and without b64 encoded' , async ( ) => {
78
78
const corsEventB64 = createMockedLambdaEvent ( 'OPTIONS' , undefined , true )
79
79
80
80
expect ( await normalizeRequest ( corsEventB64 ) ) . toEqual ( {
@@ -100,7 +100,7 @@ describe('Lambda Request', () => {
100
100
} )
101
101
102
102
describe ( 'Fetch API Request' , ( ) => {
103
- it ( 'Normalizes a fetch event' , async ( ) => {
103
+ test ( 'Normalizes a fetch event' , async ( ) => {
104
104
const fetchEvent = new Request (
105
105
'http://localhost:9210/graphql?whatsup=doc&its=bugs' ,
106
106
{
@@ -129,7 +129,7 @@ describe('Fetch API Request', () => {
129
129
expect ( partial . headers . get ( 'content-type' ) ) . toEqual ( 'application/json' )
130
130
} )
131
131
132
- it ( 'Handles an empty body' , async ( ) => {
132
+ test ( 'Handles an empty body' , async ( ) => {
133
133
const headers = {
134
134
'content-type' : 'application/json' ,
135
135
'x-custom-header' : 'bazinga' ,
0 commit comments