Move tests out of src/ into a top-level tests/ directory
src/ now contains only source code; tests live alongside it under
tests/. Bun's test runner discovers '**/*.test.ts' so no test-runner
config change is needed.
Changes:
- tests/config.test.ts (was src/config.test.ts)
- tests/configFile.test.ts (was src/configFile.test.ts)
- Imports updated: ./config.ts -> ../src/config.ts (likewise for
configFile.ts and errors.ts).
- tsconfig.json include adds 'tests/**/*.ts' so tsc type-checks
the test files too.
All 25 tests still pass; tsc clean.
This commit is contained in:
@@ -7,9 +7,9 @@
|
|||||||
|
|
||||||
import { afterEach, beforeEach, describe, expect, test } from "bun:test";
|
import { afterEach, beforeEach, describe, expect, test } from "bun:test";
|
||||||
|
|
||||||
import { DEFAULT_CONFIG, defaultConfigPath, resolveConfig } from "./config.ts";
|
import { DEFAULT_CONFIG, defaultConfigPath, resolveConfig } from "../src/config.ts";
|
||||||
import type { ConfigOverrides } from "./config.ts";
|
import type { ConfigOverrides } from "../src/config.ts";
|
||||||
import { CliError } from "./errors.ts";
|
import { CliError } from "../src/errors.ts";
|
||||||
|
|
||||||
const NONE: ConfigOverrides = {
|
const NONE: ConfigOverrides = {
|
||||||
moveInterval: undefined,
|
moveInterval: undefined,
|
||||||
@@ -10,8 +10,8 @@ import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|||||||
import { tmpdir } from "node:os";
|
import { tmpdir } from "node:os";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
|
|
||||||
import { loadConfigFile } from "./configFile.ts";
|
import { loadConfigFile } from "../src/configFile.ts";
|
||||||
import { CliError } from "./errors.ts";
|
import { CliError } from "../src/errors.ts";
|
||||||
|
|
||||||
let TMP: string;
|
let TMP: string;
|
||||||
|
|
||||||
+1
-1
@@ -12,5 +12,5 @@
|
|||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"noUncheckedIndexedAccess": true
|
"noUncheckedIndexedAccess": true
|
||||||
},
|
},
|
||||||
"include": ["src/**/*.ts"]
|
"include": ["src/**/*.ts", "tests/**/*.ts"]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user