Replies: 1 comment
-
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 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have the following Nuxt 3 server api test, sat alongside the endpoint file:
and the following vitest config:
The
beforeAll
part of the test never completes and errors after about 20 seconds with:I can't work out why this is triggering the error:
Beta Was this translation helpful? Give feedback.
All reactions