MCPcopy Create free account
hub / github.com/TanStack/db / run

Function run

packages/capacitor-db-sqlite-persistence/e2e/app/src/main.ts:67–149  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

65}
66
67async function run(): Promise<void> {
68 const platform = Capacitor.getPlatform()
69 const sqlite = new SQLiteConnection(CapacitorSQLite)
70
71 setStatus(`Starting native e2e runtime on ${platform}`)
72
73 if (platform === `web`) {
74 setStatus(`Expected a native Capacitor runtime but got web`, {
75 platform,
76 runId: runtimeRunId,
77 })
78 return
79 }
80
81 try {
82 resetRegisteredTests()
83 registerCapacitorNativeE2ESuite({
84 suiteName: `capacitor persisted collection conformance`,
85 createDatabase: createNativeCapacitorSQLiteTestDatabaseFactory({
86 sqlite,
87 runId: runtimeRunId,
88 }),
89 })
90
91 const totalTests = getRegisteredTestCount()
92 setStatus(`Running native e2e suite`, {
93 totalTests,
94 runId: runtimeRunId,
95 })
96
97 const result = await runRegisteredTests({
98 onTestStart: ({ index, name, total }) => {
99 setStatus(`Running test ${String(index)}/${String(total)}`, {
100 currentTest: name,
101 })
102 },
103 })
104
105 const failedResults = result.results.filter(
106 (entry) => entry.status === `failed`,
107 )
108 const summary = {
109 passed: result.passed,
110 failed: result.failed,
111 skipped: result.skipped,
112 total: result.total,
113 failures: failedResults.slice(0, 10),
114 }
115
116 if (result.failed > 0) {
117 await persistRunResult(sqlite, {
118 status: `failed`,
119 payload: summary,
120 })
121 setStatus(`Native e2e failed`, summary)
122 return
123 }
124

Callers 1

main.tsFile · 0.70

Calls 8

resetRegisteredTestsFunction · 0.90
getRegisteredTestCountFunction · 0.90
runRegisteredTestsFunction · 0.90
persistRunResultFunction · 0.85
filterMethod · 0.80
setStatusFunction · 0.70

Tested by

no test coverage detected