






















@@ -43,7 +43,9 @@ src/a.ts: src/a.ts
4343it("reports unexpected and stale allowlist entries", () => {
4444expect(
4545compareUnusedFilesToAllowlist(["src/a.ts", "src/new.ts"], ["src/a.ts", "src/old.ts"]),
46-).toMatchObject({
46+).toStrictEqual({
47+actual: ["src/a.ts", "src/new.ts"],
48+allowed: ["src/a.ts", "src/old.ts"],
4749unexpected: ["src/new.ts"],
4850stale: ["src/old.ts"],
4951duplicateAllowedCount: 0,
@@ -58,20 +60,36 @@ src/a.ts: src/a.ts
5860["src/a.ts"],
5961["src/platform.ts"],
6062),
61-).toMatchObject({
63+).toStrictEqual({
64+actual: ["src/a.ts", "src/platform.ts"],
65+allowed: ["src/a.ts"],
66+allowlistIsSorted: true,
67+duplicateAllowedCount: 0,
6268unexpected: [],
6369stale: [],
6470});
6571expect(
6672compareUnusedFilesToAllowlist(["src/a.ts"], ["src/a.ts"], ["src/platform.ts"]),
67-).toMatchObject({
73+).toStrictEqual({
74+actual: ["src/a.ts"],
75+allowed: ["src/a.ts"],
76+allowlistIsSorted: true,
77+duplicateAllowedCount: 0,
6878unexpected: [],
6979stale: [],
7080});
7181});
72827383it("accepts exactly allowlisted unused files", () => {
74-expect(checkUnusedFiles("Unused files (1)\nsrc/a.ts: src/a.ts\n", ["src/a.ts"])).toMatchObject({
84+expect(checkUnusedFiles("Unused files (1)\nsrc/a.ts: src/a.ts\n", ["src/a.ts"])).toStrictEqual({
85+comparison: {
86+actual: ["src/a.ts"],
87+allowed: ["src/a.ts"],
88+allowlistIsSorted: true,
89+duplicateAllowedCount: 0,
90+stale: [],
91+unexpected: [],
92+},
7593ok: true,
7694message: "",
7795});
@@ -80,8 +98,13 @@ src/a.ts: src/a.ts
8098it("rejects unsorted allowlists", () => {
8199expect(
82100compareUnusedFilesToAllowlist(["src/a.ts", "src/b.ts"], ["src/b.ts", "src/a.ts"]),
83-).toMatchObject({
101+).toStrictEqual({
102+actual: ["src/a.ts", "src/b.ts"],
103+allowed: ["src/a.ts", "src/b.ts"],
84104allowlistIsSorted: false,
105+duplicateAllowedCount: 0,
106+stale: [],
107+unexpected: [],
85108});
86109});
87110});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。