chore(repo): move app tests under packages

This commit is contained in:
t8y2
2026-05-18 02:23:58 +08:00
parent 84018eae89
commit 5dabdb3985
100 changed files with 125 additions and 125 deletions
+18
View File
@@ -0,0 +1,18 @@
import { strict as assert } from "node:assert";
import test from "node:test";
import { externalSqlFilePaths, isSqlFilePath, sqlFileTitleFromPath } from "../../src/lib/sqlFileOpen.ts";
test("detects SQL file paths case-insensitively", () => {
assert.equal(isSqlFilePath("/tmp/report.sql"), true);
assert.equal(isSqlFilePath("C:\\Users\\me\\Query.SQL"), true);
assert.equal(isSqlFilePath("/tmp/report.txt"), false);
});
test("derives a tab title from Unix or Windows SQL paths", () => {
assert.equal(sqlFileTitleFromPath("/tmp/report.sql"), "report.sql");
assert.equal(sqlFileTitleFromPath("C:\\Users\\me\\Query.SQL"), "Query.SQL");
});
test("filters external open payloads down to SQL files", () => {
assert.deepEqual(externalSqlFilePaths(["/tmp/a.sql", "/tmp/readme.md", "/tmp/b.SQL"]), ["/tmp/a.sql", "/tmp/b.SQL"]);
});