* 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>
27 lines
758 B
TypeScript
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',
|
|
},
|
|
])
|
|
}),
|
|
]
|