Skip to content

Commit

Permalink
unmount cleaner
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAMathews committed Nov 18, 2024
1 parent b766fd8 commit 7465ceb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
14 changes: 8 additions & 6 deletions packages/react-hooks/test/support/test-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ export const testWithDbClient = test.extend<{
clearShape: async ({}, use) => {
use(async (table: string, shapeHandle?: string) => {
const baseUrl = inject(`baseUrl`)
const resp = await fetch(
`${baseUrl}/v1/shape?table=${table}${shapeHandle ? `&handle=${shapeHandle}` : ``}`,
{
method: `DELETE`,
}
)
const url = new URL(`${baseUrl}/v1/shape`)
url.searchParams.set(`table`, table)
if (shapeHandle) {
url.searchParams.set(`handle`, shapeHandle)
}
const resp = await fetch(url.toString(), {
method: `DELETE`,
})
if (!resp.ok) {
console.error(
await FetchError.fromResponse(
Expand Down
3 changes: 2 additions & 1 deletion packages/typescript-client/test/support/test-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ export const testWithDbClient = test.extend<{
} = {}
) => {
const baseUrl = inject(`baseUrl`)
const url = new URL(`${baseUrl}/v1/shape?table=${table}`)
const url = new URL(`${baseUrl}/v1/shape`)
url.searchParams.set(`table`, table)

if (!options.databaseId) {
options.databaseId = inject(`databaseId`)
Expand Down

0 comments on commit 7465ceb

Please sign in to comment.