test: add test for valid jar artifacts
This commit is contained in:
parent
58bb403787
commit
e527f043b0
26
test/bin/jar.spec.ts
Normal file
26
test/bin/jar.spec.ts
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
import jar from "keycloakify/bin/tools/jar";
|
||||||
|
import { it, describe, vi } from "vitest";
|
||||||
|
|
||||||
|
vi.mock("fs", () => ({ promises: { mkdir: () => {} }, createWriteStream: () => {} }));
|
||||||
|
vi.mock("stream", async () => {
|
||||||
|
const readableMock = () => {
|
||||||
|
const mockDecorators = {
|
||||||
|
on: () => mockDecorators,
|
||||||
|
pipe: () => mockDecorators
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
from: () => mockDecorators
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
// @ts-ignore
|
||||||
|
...(await vi.importActual("stream")),
|
||||||
|
Readable: readableMock()
|
||||||
|
};
|
||||||
|
});
|
||||||
|
describe("jar", () => {
|
||||||
|
it("creates jar artifacts without error", () => {
|
||||||
|
jar({ artifactId: "artifactId", groupId: "groupId", rootPath: "rootPath", targetPath: "targetPath", version: "1.0.0" });
|
||||||
|
});
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user