mirror of
https://github.com/supabase/supabase.git
synced 2026-10-16 06:39:09 +03:00
* Add all missing libraries in the packages/apps. * Add all missing Vitest imports to the tests. * Add some missing exports to ui. * Fix the admonition export. * Fix various minor bugs. * Migrate the ui package to use vitest.
17 lines
459 B
TypeScript
17 lines
459 B
TypeScript
import { API_URL } from 'lib/constants'
|
|
import { test, expect } from 'vitest'
|
|
|
|
test('MSW works as expected', async () => {
|
|
const res = await fetch(`${API_URL}/msw/test`)
|
|
const json = await res.json()
|
|
|
|
expect(res.status).toBe(200)
|
|
expect(json).toEqual({ message: 'Hello from MSW!' })
|
|
})
|
|
|
|
test('MSW fails on missing endpoints', async () => {
|
|
expect(async () => {
|
|
await fetch(`${API_URL}/endpoint-that-doesnt-exist`)
|
|
}).rejects.toThrowError()
|
|
})
|