mirror of
https://github.com/morluto/rea.git
synced 2026-12-06 14:59:05 +00:00
test(artifacts): reuse temporary files in Android reader fixtures (#14750)
This commit is contained in:
1 parent
94c1c6aec0
commit
da129c00a3
3 files changed
+10
-26
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { createHash } from "node:crypto";
|
||||
import { readFile, writeFile } from "node:fs/promises";
|
||||
import { readFile } from "node:fs/promises";
|
||||
import { join } from "node:path";
|
||||
|
||||
import { expect, it } from "vitest";
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
import { zipArchive } from "../domain/desktop/zipArchive.fixture.js";
|
||||
import { buildBootImage } from "../../tests/fixtures/androidBootImage.js";
|
||||
import { classifyArtifactBytesAtPath } from "../../tests/fixtures/artifactClassification.js";
|
||||
import { createTestTempDirectory } from "../../tests/fixtures/temporaryDirectory.js";
|
||||
import { createTestTempFile } from "../../tests/fixtures/temporaryDirectory.js";
|
||||
import { scanCanonicalArtifactInventory } from "../../tests/fixtures/artifactInventory.js";
|
||||
|
||||
type Snapshot = Awaited<ReturnType<typeof scanCanonicalArtifactInventory>>;
|
||||
@@ -30,11 +30,8 @@ const nodeAt = (snapshot: Snapshot, logicalPath: string) => {
|
||||
);
|
||||
};
|
||||
|
||||
const writeCarrier = async (name: string, bytes: Buffer): Promise<string> => {
|
||||
const path = join(await createTestTempDirectory("rea-android-sparse-"), name);
|
||||
await writeFile(path, bytes);
|
||||
return path;
|
||||
};
|
||||
const writeCarrier = (name: string, bytes: Buffer): Promise<string> =>
|
||||
createTestTempFile("rea-android-sparse-", name, bytes);
|
||||
|
||||
it("classifies sparse image bytes as a container by magic, not by suffix", () => {
|
||||
expect(
|
||||
|
||||
Reference in new issue
Block a user