Replies: 3 comments 2 replies
|
Hey there, @alexcroox! I'm here to assist you with any bugs, questions, or contributions you have. Let's dive in and see how I can help you out! The error you're encountering is due to the import { fileURLToPath } from 'node:url'
import { $fetch, setup } from '@nuxt/test-utils/e2e'
import { describe, expect, it } from 'vitest'
await setup({
rootDir: fileURLToPath(new URL('../', import.meta.url)),
dev: true,
})
describe('signed-url.post', () => {
it('should return signed upload url', async () => {
const response = await $fetch('/api/file/v1/signed-url', {
method: 'POST',
body: JSON.stringify({
category: 'profile',
name: 'test.jpg',
sizeBytes: 1000,
mimeType: 'image/jpeg'
})
})
// Add your assertions here
})
})Make sure to place the |
1 reply
|
@alexcroox Were you able to get this working? I'm stuck with this same issue and nothing has worked so far. |
0 replies
|
Afraid not, I gave up trying to unit test the server side of Nuxt a while ago :( |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I have the following Nuxt 3 server api test, sat alongside the endpoint file:
and the following vitest config:
The
beforeAllpart of the test never completes and errors after about 20 seconds with:I can't work out why this is triggering the error:
All reactions