mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-12 21:12:55 +00:00
chore: fix temp-path guard skip for *.test-helpers.ts
This commit is contained in:
@@ -10,7 +10,7 @@ const SKIP_PATTERNS = [
|
|||||||
/\.e2e\.tsx?$/,
|
/\.e2e\.tsx?$/,
|
||||||
/\.d\.ts$/,
|
/\.d\.ts$/,
|
||||||
/[\\/](?:__tests__|tests)[\\/]/,
|
/[\\/](?:__tests__|tests)[\\/]/,
|
||||||
/[\\/]test-helpers(?:\.[^\\/]+)?\.ts$/,
|
/[\\/][^\\/]*test-helpers(?:\.[^\\/]+)?\.ts$/,
|
||||||
];
|
];
|
||||||
|
|
||||||
function shouldSkip(relativePath: string): boolean {
|
function shouldSkip(relativePath: string): boolean {
|
||||||
@@ -40,6 +40,12 @@ async function listTsFiles(dir: string): Promise<string[]> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
describe("temp path guard", () => {
|
describe("temp path guard", () => {
|
||||||
|
it("skips test helper filename variants", () => {
|
||||||
|
expect(shouldSkip("src/commands/test-helpers.ts")).toBe(true);
|
||||||
|
expect(shouldSkip("src/commands/sessions.test-helpers.ts")).toBe(true);
|
||||||
|
expect(shouldSkip("src\\commands\\sessions.test-helpers.ts")).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
it("blocks dynamic template path.join(os.tmpdir(), ...) in runtime source files", async () => {
|
it("blocks dynamic template path.join(os.tmpdir(), ...) in runtime source files", async () => {
|
||||||
const repoRoot = process.cwd();
|
const repoRoot = process.cwd();
|
||||||
const offenders: string[] = [];
|
const offenders: string[] = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user