@thi.ng/testament
Advanced tools
Comparing version 0.3.24 to 0.4.1
# Change Log | ||
- **Last updated**: 2023-10-23T07:37:37Z | ||
- **Last updated**: 2023-11-09T10:28:19Z | ||
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub) | ||
@@ -12,2 +12,9 @@ | ||
## [0.4.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/testament@0.4.0) (2023-11-09) | ||
#### 🚀 Features | ||
- only allow subdirs for locating tests ([3f51da7](https://github.com/thi-ng/umbrella/commit/3f51da7)) | ||
- only allow subdirs for locating tests ([d48377c](https://github.com/thi-ng/umbrella/commit/d48377c)) | ||
## [0.3.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/testament@0.3.0) (2022-09-21) | ||
@@ -14,0 +21,0 @@ |
15
cli.js
// thing:no-export | ||
import { watch } from "chokidar"; | ||
import { readdirSync, statSync, writeFileSync } from "fs"; | ||
import { resolve } from "path"; | ||
import { normalize, resolve } from "path"; | ||
import { GLOBAL_OPTS } from "./api.js"; | ||
@@ -153,6 +153,11 @@ import { execute } from "./exec.js"; | ||
}; | ||
const cwd = process.cwd(); | ||
for (let src of opts.rest) { | ||
src = resolve(src); | ||
if (statSync(src).isDirectory()) { | ||
for (let f of files(src, /\.[jt]s$/)) { | ||
const resolvedPath = resolve(normalize(src)); | ||
if (!resolvedPath.startsWith(cwd)) { | ||
process.stderr.write(`illegal path (${src}), only sub-directories are supported\n`); | ||
process.exit(1); | ||
} | ||
if (statSync(resolvedPath).isDirectory()) { | ||
for (let f of files(resolvedPath, /\.[jt]s$/)) { | ||
if (excludes.some((prefix) => f.startsWith(prefix))) | ||
@@ -164,3 +169,3 @@ continue; | ||
else { | ||
enque(src); | ||
enque(resolvedPath); | ||
} | ||
@@ -167,0 +172,0 @@ } |
{ | ||
"name": "@thi.ng/testament", | ||
"version": "0.3.24", | ||
"version": "0.4.1", | ||
"description": "Minimal, rational & TypeScript-friendly test runner, result export as CSV/JSON, watch mode, file fixtures", | ||
@@ -32,16 +32,15 @@ "type": "module", | ||
"doc:ae": "mkdir -p .ae/doc .ae/temp && api-extractor run --local --verbose", | ||
"doc:readme": "yarn doc:stats && tools:readme", | ||
"doc:stats": "tools:module-stats", | ||
"doc:readme": "bun ../../tools/src/module-stats.ts && bun ../../tools/src/readme.ts", | ||
"pub": "yarn npm publish --access public", | ||
"test": "testament test" | ||
"test": "bun test" | ||
}, | ||
"dependencies": { | ||
"@thi.ng/logger": "^1.4.22", | ||
"@thi.ng/logger": "^1.4.24", | ||
"chokidar": "^3.5.3" | ||
}, | ||
"devDependencies": { | ||
"@microsoft/api-extractor": "^7.38.0", | ||
"@microsoft/api-extractor": "^7.38.2", | ||
"rimraf": "^5.0.5", | ||
"tools": "^0.0.1", | ||
"typedoc": "^0.25.2", | ||
"typedoc": "^0.25.3", | ||
"typescript": "^5.2.2" | ||
@@ -103,3 +102,3 @@ }, | ||
}, | ||
"gitHead": "8d46d9326a9f9b81d65e7e274446f5964f9942ac\n" | ||
"gitHead": "669a3151e4302480244fe3e60eff5e732ea5b7a7\n" | ||
} |
51538
904
Updated@thi.ng/logger@^1.4.24