neq support
All checks were successful
Publish npm package / publish (push) Successful in 1m24s

This commit is contained in:
Gregor Lohaus
2026-05-24 15:46:25 +02:00
parent e16fc8b482
commit 0fab9c8d38
7 changed files with 36 additions and 9 deletions

View File

@@ -568,3 +568,25 @@ test("if eq in path", () => {
render(tmp,{test:"foo"})
expect(existsSync(join(tmp,"test"))).toBe(false)
})
test("if neq in file", () => {
const createRenderer = initRenderer("./testdata/neq_in_file")
expect(() => createRenderer(z.object({test: z.boolean()}))).toThrow(SchemaMismatchError)
const render = createRenderer(z.object({test: z.string()}))
render(tmp,{test:"foo"})
expect(readFileSync(join(tmp,"test.txt"), "utf-8")).toContain("not-test")
render(tmp,{test:"test"})
expect(readFileSync(join(tmp,"test.txt"), "utf-8")).toContain("test")
expect(readFileSync(join(tmp,"test.txt"), "utf-8")).not.toContain("not-test")
})
test("if neq in path", () => {
const createRenderer = initRenderer("./testdata/neq_in_path")
const render = createRenderer(z.object({test: z.string()}))
render(tmp,{test:"foo"})
expect(existsSync(join(tmp,"not-test"))).toBe(true)
render(tmp,{test:"test"})
expect(existsSync(join(tmp,"not-test"))).toBe(false)
})