mirror of
https://github.com/merlinhu1/truthmark.git
synced 2026-08-25 07:53:25 +02:00
27 lines
829 B
TypeScript
27 lines
829 B
TypeScript
import path from "node:path";
|
|||
|
|
import { fileURLToPath } from "node:url";
|
||
|
|
|
||
|
|
import { execa } from "execa";
|
||
|
|
import { describe, expect, it } from "vitest";
|
||
|
|
|
||
|
|
const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
||
|
|
|
||
|
|
describe("package tarball contents", () => {
|
||
|
|
it("includes localized README files linked from the published README", async () => {
|
||
|
|
const { stdout } = await execa("npm", ["pack", "--dry-run", "--json"], {
|
||
|
|
cwd: repoRoot,
|
||
|
|
});
|
||
|
|
const packOutput = JSON.parse(stdout) as Array<{ files: Array<{ path: string }> }>;
|
||
|
|
const tarballPaths = packOutput[0]?.files.map((file) => file.path) ?? [];
|
||
|
|
|
||
|
|
expect(tarballPaths).toEqual(
|
||
|
|
expect.arrayContaining([
|
||
|
|
"README.de.md",
|
||
|
|
"README.es.md",
|
||
|
|
"README.ru.md",
|
||
|
|
"README.zh.md",
|
||
|
|
]),
|
||
|
|
);
|
||
|
|
});
|
||
|
|
});
|