Skip to content
Source
Sign inSign up
TanStack/db

test(db): add controlled includes oracle drivers #1720

MergedKyleAMathews(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/1720/headmerged by tannerlinsley

Showing 6 changed files with 95 additions and 0 deletions (loading 4).

x
0 of 6 viewed, 6 left
66 additions and 0 deletionspackages/db/tests/expected-failure.test.tsAdded
View file
@@ -0,0 +1,66 @@
+import { describe, expect, it } from 'vitest'
+import { expectAssertionFailure } from './expected-failure.js'
+import { TraceAssertionError } from './trace-runner.js'
+​
+describe(`expected failure guard`, () => {
+ it(`accepts an assertion mismatch at the expected checkpoint`, async () => {
+ const guarded = expectAssertionFailure(
+ () => {
+ try {
+ expect(`observed`).toBe(`expected`)
+ return Promise.resolve()
+ } catch (error) {
+ return Promise.reject(new TraceAssertionError(2, error))
+ }
+ },
+ { checkpoint: 2 },
+ )
+​
+ await guarded()
+ })
+​
+ it(`rejects an assertion mismatch from the wrong checkpoint`, async () => {
+ const guarded = expectAssertionFailure(
+ () =>
+ Promise.reject(
+ new TraceAssertionError(0, new Error(`startup mismatch`)),
+ ),