From e4e4ce0f7380ccd4e0e42848a0e6ef68b0745c42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=9B=A2=E5=AD=90?= Date: Thu, 4 Jun 2026 00:36:38 +0000 Subject: [PATCH] fix: suppress SQLite ExperimentalWarning in edge-cases and schema-validation tests The local runCli helpers in edge-cases.test.ts (Phase 3/4/7) and raw execFileSync calls in schema-validation.test.ts (tests 2.1, 2.3) were missing NODE_NO_WARNINGS=1, causing ExperimentalWarning to leak into stderr snapshots. Added env override to match what helpers.runCli already does. --- .../__snapshots__/edge-cases.test.ts.snap | 30 ++++--------------- .../schema-validation.test.ts.snap | 6 +--- packages/cli/tests/edge-cases.test.ts | 3 ++ packages/cli/tests/schema-validation.test.ts | 2 ++ 4 files changed, 11 insertions(+), 30 deletions(-) diff --git a/packages/cli/tests/__snapshots__/edge-cases.test.ts.snap b/packages/cli/tests/__snapshots__/edge-cases.test.ts.snap index dfed0d3..6712568 100644 --- a/packages/cli/tests/__snapshots__/edge-cases.test.ts.snap +++ b/packages/cli/tests/__snapshots__/edge-cases.test.ts.snap @@ -373,11 +373,7 @@ exports[`Phase 3: Variable System > 3.10 var delete removes variable 1`] = ` } `; -exports[`Phase 3: Variable System > 3.11 var get deleted variable returns not found 1`] = ` -"(node:310067) ExperimentalWarning: SQLite is an experimental feature and might change at any time -(Use \`node --trace-warnings ...\` to show where the warning was created) -Error: Variable not found: name=@myapp/config, schema=FRBAB1BF0ZBCS" -`; +exports[`Phase 3: Variable System > 3.11 var get deleted variable returns not found 1`] = `"Error: Variable not found: name=@myapp/config, schema=FRBAB1BF0ZBCS"`; exports[`Phase 4: Template System > 4.1 template set registers template 1`] = ` { @@ -417,29 +413,13 @@ exports[`Phase 4: Template System > 4.4 template delete removes template 1`] = ` } `; -exports[`Phase 4: Template System > 4.5 template get deleted template returns not found 1`] = ` -"(node:310291) ExperimentalWarning: SQLite is an experimental feature and might change at any time -(Use \`node --trace-warnings ...\` to show where the warning was created) -Error: Template not found for schema: FRBAB1BF0ZBCS" -`; +exports[`Phase 4: Template System > 4.5 template get deleted template returns not found 1`] = `"Error: Template not found for schema: FRBAB1BF0ZBCS"`; -exports[`Phase 7: Edge Cases > 7.1 get non-existent hash errors gracefully 1`] = ` -"(node:309275) ExperimentalWarning: SQLite is an experimental feature and might change at any time -(Use \`node --trace-warnings ...\` to show where the warning was created) -Node not found: AAAAAAAAAAAAA" -`; +exports[`Phase 7: Edge Cases > 7.1 get non-existent hash errors gracefully 1`] = `"Node not found: AAAAAAAAAAAAA"`; -exports[`Phase 7: Edge Cases > 7.3 var set empty name errors 1`] = ` -"(node:309358) ExperimentalWarning: SQLite is an experimental feature and might change at any time -(Use \`node --trace-warnings ...\` to show where the warning was created) -Usage: ocas var set [--tag ...]" -`; +exports[`Phase 7: Edge Cases > 7.3 var set empty name errors 1`] = `"Usage: ocas var set [--tag ...]"`; -exports[`Phase 7: Edge Cases > 7.4 var set name with invalid chars errors 1`] = ` -"(node:309380) ExperimentalWarning: SQLite is an experimental feature and might change at any time -(Use \`node --trace-warnings ...\` to show where the warning was created) -Error: Invalid variable name "invalid name!": Name must follow @scope/name format (e.g. @myapp/config)" -`; +exports[`Phase 7: Edge Cases > 7.4 var set name with invalid chars errors 1`] = `"Error: Invalid variable name "invalid name!": Name must follow @scope/name format (e.g. @myapp/config)"`; exports[`Phase 7: Edge Cases > 7.5 no subcommand shows help text 1`] = ` "Usage: ocas [--home ] [--json] [args] diff --git a/packages/cli/tests/__snapshots__/schema-validation.test.ts.snap b/packages/cli/tests/__snapshots__/schema-validation.test.ts.snap index f46b8f5..e255fdb 100644 --- a/packages/cli/tests/__snapshots__/schema-validation.test.ts.snap +++ b/packages/cli/tests/__snapshots__/schema-validation.test.ts.snap @@ -1,7 +1,3 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`Phase 2: Schema Validation > 2.3 put against non-existent schema hash fails 1`] = ` -"(node:311027) ExperimentalWarning: SQLite is an experimental feature and might change at any time -(Use \`node --trace-warnings ...\` to show where the warning was created) -Schema not found: AAAAAAAAAAAAA" -`; +exports[`Phase 2: Schema Validation > 2.3 put against non-existent schema hash fails 1`] = `"Schema not found: AAAAAAAAAAAAA"`; diff --git a/packages/cli/tests/edge-cases.test.ts b/packages/cli/tests/edge-cases.test.ts index f55fd2e..715fdd3 100644 --- a/packages/cli/tests/edge-cases.test.ts +++ b/packages/cli/tests/edge-cases.test.ts @@ -52,6 +52,7 @@ describe("Phase 7: Edge Cases", () => { { encoding: "utf-8", timeout: 10000, + env: { ...process.env, NODE_NO_WARNINGS: "1" }, }, ); return { stdout: stdout.trim(), stderr: "", exitCode: 0 }; @@ -177,6 +178,7 @@ describe("Phase 3: Variable System", () => { { encoding: "utf-8", timeout: 10000, + env: { ...process.env, NODE_NO_WARNINGS: "1" }, }, ); return { stdout: stdout.trim(), stderr: "", exitCode: 0 }; @@ -379,6 +381,7 @@ describe("Phase 4: Template System", () => { { encoding: "utf-8", timeout: 10000, + env: { ...process.env, NODE_NO_WARNINGS: "1" }, }, ); return { stdout: stdout.trim(), stderr: "", exitCode: 0 }; diff --git a/packages/cli/tests/schema-validation.test.ts b/packages/cli/tests/schema-validation.test.ts index 5325f5e..52a8952 100644 --- a/packages/cli/tests/schema-validation.test.ts +++ b/packages/cli/tests/schema-validation.test.ts @@ -610,6 +610,7 @@ describe("Phase 2: Schema Validation", () => { { encoding: "utf-8", timeout: 10000, + env: { ...process.env, NODE_NO_WARNINGS: "1" }, }, ).trim(); } catch (e: unknown) { @@ -635,6 +636,7 @@ describe("Phase 2: Schema Validation", () => { { encoding: "utf-8", timeout: 10000, + env: { ...process.env, NODE_NO_WARNINGS: "1" }, }, ); } catch (e: unknown) {