Release Package Tools 0.2.0
Verify / verify (push) Canceled after 0s

This commit is contained in:
2026-09-02 11:29:24 +02:00
parent e42943e689
commit 01c7a8c372
32 changed files with 1316 additions and 85 deletions
+37 -1
View File
@@ -104,7 +104,19 @@ describe("compound package analysis", () => {
const jar = await analyzePackage(
archive("tool.jar", {
"META-INF/MANIFEST.MF": strToU8(
"Manifest-Version: 1.0\r\nMain-Class: example.Main\r\n",
"Manifest-Version: 1.0\r\nMain-Class: example.Main\r\nClass-Path: lib/a.jar lib/b.jar\r\n",
),
"META-INF/LOCAL.SF": strToU8(
"Signature-Version: 1.0\r\nSHA-256-Digest-Manifest: abc\r\n",
),
"META-INF/LOCAL.RSA": new Uint8Array([1, 2, 3]),
"META-INF/LICENSE.txt": strToU8("Example licence evidence"),
"package.json": strToU8(
JSON.stringify({
dependencies: { alpha: "^1.2.0" },
devDependencies: { beta: "2.0.0" },
license: "MIT",
}),
),
"example/Main.class": new Uint8Array([0xca, 0xfe, 0xba, 0xbe]),
}),
@@ -115,6 +127,30 @@ describe("compound package analysis", () => {
name: "Main-Class",
value: "example.Main",
});
expect(jar.dependencies).toEqual(
expect.arrayContaining([
expect.objectContaining({ name: "alpha", scope: "runtime" }),
expect.objectContaining({
name: "lib/a.jar",
scope: "JAR Class-Path declaration",
}),
]),
);
expect(jar.licenses).toEqual(
expect.arrayContaining([
expect.objectContaining({ name: "MIT", source: "package.json" }),
expect.objectContaining({ source: "META-INF/LICENSE.txt" }),
]),
);
expect(jar.signatures).toEqual(
expect.arrayContaining([
expect.objectContaining({
path: "META-INF/LOCAL.SF",
state: "complete-pair",
declaredDigests: ["SHA-256"],
}),
]),
);
});
it("adapts APK and both WebExtension identities with bounded inventories", async () => {