Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): pass specific status to HyperErr on known errors and bubble as non fatal #621 #622

Merged
merged 2 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 30 additions & 15 deletions packages/app-express/api/cache.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ Deno.test('cache', async (t) => {
return res.body?.cancel()
})
)
.finally(async () => await harness.stop())
.then(() => harness.stop())
.catch(() => harness.stop())
})

await t.step('should pass name route param to core', async () => {
Expand All @@ -86,7 +87,8 @@ Deno.test('cache', async (t) => {
assertEquals(body.name, 'movies')
})
)
.finally(async () => await harness.stop())
.then(() => harness.stop())
.catch(() => harness.stop())
})
})

Expand All @@ -103,7 +105,8 @@ Deno.test('cache', async (t) => {
return res.body?.cancel()
})
)
.finally(async () => await harness.stop())
.then(() => harness.stop())
.catch(() => harness.stop())
})

await t.step('should pass name route param to core', async () => {
Expand All @@ -116,7 +119,8 @@ Deno.test('cache', async (t) => {
assertEquals(body.name, 'movies')
})
)
.finally(async () => await harness.stop())
.then(() => harness.stop())
.catch(() => harness.stop())
})
})

Expand Down Expand Up @@ -148,7 +152,8 @@ Deno.test('cache', async (t) => {
},
)
)
.finally(async () => await harness.stop())
.then(() => harness.stop())
.catch(() => harness.stop())
})

await t.step(
Expand All @@ -174,7 +179,8 @@ Deno.test('cache', async (t) => {
assertEquals(body.pattern, 'foo*')
})
)
.finally(async () => await harness.stop())
.then(() => harness.stop())
.catch(() => harness.stop())
},
)
})
Expand All @@ -199,7 +205,8 @@ Deno.test('cache', async (t) => {
return res.body?.cancel()
})
)
.finally(async () => await harness.stop())
.then(() => harness.stop())
.catch(() => harness.stop())
})

await t.step('should pass name route param and body to core', async () => {
Expand All @@ -222,7 +229,8 @@ Deno.test('cache', async (t) => {
assertEquals(body.ttl, '1m')
})
)
.finally(async () => await harness.stop())
.then(() => harness.stop())
.catch(() => harness.stop())
})
})

Expand All @@ -239,7 +247,8 @@ Deno.test('cache', async (t) => {
return res.body?.cancel()
})
)
.finally(async () => await harness.stop())
.then(() => harness.stop())
.catch(() => harness.stop())
})

await t.step('should pass name and key route params to core', async () => {
Expand All @@ -253,7 +262,8 @@ Deno.test('cache', async (t) => {
assertEquals(body.doc.name, 'movies')
})
)
.finally(async () => await harness.stop())
.then(() => harness.stop())
.catch(() => harness.stop())
})

await t.step('should pass isLegacyGetEnabled to core', async () => {
Expand All @@ -270,7 +280,8 @@ Deno.test('cache', async (t) => {
assertEquals(withLegacy.doc.isLegacyGetEnabled, true)
})
)
.finally(async () => await harness.stop())
.then(() => harness.stop())
.catch(() => harness.stop())
})
})

Expand All @@ -290,7 +301,8 @@ Deno.test('cache', async (t) => {
return res.body?.cancel()
})
)
.finally(async () => await harness.stop())
.then(() => harness.stop())
.catch(() => harness.stop())
})

await t.step(
Expand All @@ -311,7 +323,8 @@ Deno.test('cache', async (t) => {
assertEquals(body.ttl, '1m')
})
)
.finally(async () => await harness.stop())
.then(() => harness.stop())
.catch(() => harness.stop())
},
)
})
Expand All @@ -329,7 +342,8 @@ Deno.test('cache', async (t) => {
return res.body?.cancel()
})
)
.finally(async () => await harness.stop())
.then(() => harness.stop())
.catch(() => harness.stop())
})

await t.step('should pass name and key route params to core', async () => {
Expand All @@ -343,7 +357,8 @@ Deno.test('cache', async (t) => {
assertEquals(body.key, 'key')
})
)
.finally(async () => await harness.stop())
.then(() => harness.stop())
.catch(() => harness.stop())
})
})
})
24 changes: 16 additions & 8 deletions packages/app-express/api/crawler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ Deno.test('crawler', async (t) => {
return res.body?.cancel()
})
)
.finally(async () => await harness.stop())
.then(() => harness.stop())
.catch(() => harness.stop())
})

await t.step(
Expand Down Expand Up @@ -88,7 +89,8 @@ Deno.test('crawler', async (t) => {
assertObjectMatch(body.def, crawlerDefinition)
})
)
.finally(async () => await harness.stop())
.then(() => harness.stop())
.catch(() => harness.stop())
},
)
})
Expand All @@ -106,7 +108,8 @@ Deno.test('crawler', async (t) => {
return res.body?.cancel()
})
)
.finally(async () => await harness.stop())
.then(() => harness.stop())
.catch(() => harness.stop())
})

await t.step(
Expand All @@ -120,7 +123,8 @@ Deno.test('crawler', async (t) => {
assertEquals(body.bucket, 'test')
assertEquals(body.name, 'spider')
})
.finally(async () => await harness.stop())
.then(() => harness.stop())
.catch(() => harness.stop())
},
)
})
Expand All @@ -140,7 +144,8 @@ Deno.test('crawler', async (t) => {
},
)
)
.finally(async () => await harness.stop())
.then(() => harness.stop())
.catch(() => harness.stop())
})

await t.step(
Expand All @@ -154,7 +159,8 @@ Deno.test('crawler', async (t) => {
assertEquals(body.bucket, 'test')
assertEquals(body.name, 'spider')
})
.finally(async () => await harness.stop())
.then(() => harness.stop())
.catch(() => harness.stop())
},
)
})
Expand All @@ -172,7 +178,8 @@ Deno.test('crawler', async (t) => {
return res.body?.cancel()
})
)
.finally(async () => await harness.stop())
.then(() => harness.stop())
.catch(() => harness.stop())
})

await t.step(
Expand All @@ -186,7 +193,8 @@ Deno.test('crawler', async (t) => {
assertEquals(body.bucket, 'test')
assertEquals(body.name, 'spider')
})
.finally(async () => await harness.stop())
.then(() => harness.stop())
.catch(() => harness.stop())
},
)
})
Expand Down
Loading
Loading