Files
supabase/apps/studio/tests/lib/msw-global-api-mocks.ts
Jordi Enric 3c588294a6 Improve Integration Test Setup and re-add LogPreviewer tests (#35358)
* fix logs previewer and msw

* refactor api mocking for better dx

* update readme

* comment out error handler for vitest

* rm unnecessary tests

* fix custom render nuqs type

* add logs search test

* rm unnecessary import

* update readme with customRender and customRednerHook

* rm unnecessary api handler

* Move the NODE_ENV to the studio build command in turbo.json.

* Update apps/studio/tests/README.md

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>

* add cursor rule

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-05-06 09:50:56 +02:00

27 lines
758 B
TypeScript

import { API_URL } from 'lib/constants'
import { HttpResponse, http } from 'msw'
export const GlobalAPIMocks = [
http.get(`${API_URL}/msw/test`, () => {
return HttpResponse.json({ message: 'Hello from MSW!' })
}),
http.get(`${API_URL}/platform/projects/default/databases`, () => {
return HttpResponse.json([
{
cloud_provider: 'AWS',
connectionString: '123',
connection_string_read_only: '123',
db_host: '123',
db_name: 'postgres',
db_port: 5432,
identifier: 'default',
inserted_at: '2025-02-16T22:24:42.115195',
region: 'us-east-1',
restUrl: 'https://default.supabase.co',
size: 't4g.nano',
status: 'ACTIVE_HEALTHY',
},
])
}),
]