Skip to content
Source
Sign inSign up
TanStack/db

test: useLiveQuery conformance suite across all five framework adapters (RFC #1623) #1636

Mergedkevin-dp(GitHub profile, opens in a new tab)merged 15 commits intomain fromrefs/pull/1636/headmerged by kevin-dp(GitHub profile, opens in a new tab)

Showing 7 changed files with 227 additions and 0 deletions (loading 6).

x
0 of 7 viewed, 7 left
227 additions and 0 deletionspackages/angular-db/tests/conformance.test.tsAdded
View file
@@ -0,0 +1,227 @@
+/**
+ * Angular driver for the shared live-query conformance suite.
+ *
+ * `injectLiveQuery` needs an injection context, so each mount runs inside a
+ * child `EnvironmentInjector` created off TestBed's; `unmount` calls
+ * `injector.destroy()`, firing the `DestroyRef` cleanup. Result signals are read
+ * after settling. Controllable inputs use Angular's reactive `{ params, query }`
+ * form driven by a signal.
+ *
+ * `knownGaps` is populated empirically from the run below.
+ */
+import {
+ EnvironmentInjector,
+ createEnvironmentInjector,
+ runInInjectionContext,
+ signal,
+} from '@angular/core'
+import { TestBed } from '@angular/core/testing'
+import {
+ coalesce,
+ count,
+ createCollection,
+ createLiveQueryCollection,
+ createOptimisticAction,
+ eq,
+ gt,
+ sum,