vi.stubGlobal('readBody', (e: any) => e.context.body);
const { email, password } = await readBody(event);
const event = { context: { body: { email: '[email protected]', password: 'wrongpassword', }, }, } as unknown as H3Event<EventHandlerRequest>;
- Expected+ Received- Object {- "email": "[email protected]",- "firstName": "John",- "idUser": "f91acba9-8bf7-423c-a737-96fd6cd346a1",- "lastName": "Doe",- "platformRole": "ADMIN",- "title": "CEO",- }+ [TypeError: Cannot read properties of undefined (reading 'req')]