Robin
Robin
NNuxt
Created by w7a9q on 7/4/2024 in #❓・help
OpenAPI specs through Nitro
You can try updating nitro to 2.9.7
2 replies
NNuxt
Created by Robin on 4/9/2024 in #❓・help
Unit Tests for Nuxt's /server Directory
With something like that ?
vi.stubGlobal('readBody', (e: any) => e.context.body);
vi.stubGlobal('readBody', (e: any) => e.context.body);
14 replies
NNuxt
Created by Robin on 4/9/2024 in #❓・help
Unit Tests for Nuxt's /server Directory
This const { email, password } = await readBody(event); ?
14 replies
NNuxt
Created by Robin on 4/9/2024 in #❓・help
Unit Tests for Nuxt's /server Directory
I think it's in event intialization, something miss no ?
const event = {
context: {
body: {
password: 'wrongpassword',
},
},
} as unknown as H3Event<EventHandlerRequest>;
const event = {
context: {
body: {
password: 'wrongpassword',
},
},
} as unknown as H3Event<EventHandlerRequest>;
14 replies
NNuxt
Created by Robin on 4/9/2024 in #❓・help
Unit Tests for Nuxt's /server Directory
Thanks for your code, you help me a lot with this! On the other hand I have an error, did you already get it?
- 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')]
- 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')]
14 replies