Initial Commit
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
import * as fs from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { describe, expect, it } from "@suaveplan/testing/runner";
|
||||
|
||||
const PKG_ROOT = join(import.meta.dirname ?? __dirname, "..");
|
||||
|
||||
describe("exports", () => {
|
||||
it("every feature module has a subpath export entry", {
|
||||
timeout: 5000,
|
||||
}, () => {
|
||||
const pkg = JSON.parse(
|
||||
fs.readFileSync(join(PKG_ROOT, "package.json"), "utf8")
|
||||
) as { exports: Record<string, unknown> };
|
||||
const required = [
|
||||
".",
|
||||
"./adapter/browser-adapter",
|
||||
"./graph/web-audio-graph",
|
||||
"./worklet/worklet-manager",
|
||||
"./fallback/html5-fallback",
|
||||
"./offline/offline-render",
|
||||
];
|
||||
for (const key of required) {
|
||||
expect(Object.keys(pkg.exports)).toContain(key);
|
||||
}
|
||||
});
|
||||
|
||||
it("sideEffects is false", { timeout: 5000 }, () => {
|
||||
const pkg = JSON.parse(
|
||||
fs.readFileSync(join(PKG_ROOT, "package.json"), "utf8")
|
||||
) as { sideEffects: boolean };
|
||||
expect(pkg.sideEffects).toBe(false);
|
||||
});
|
||||
|
||||
it("package version is 0.1.0", { timeout: 5000 }, () => {
|
||||
const pkg = JSON.parse(
|
||||
fs.readFileSync(join(PKG_ROOT, "package.json"), "utf8")
|
||||
) as { version: string };
|
||||
expect(pkg.version).toBe("0.1.0");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user