Skip to content

Commit d27cc02

Browse files
authored
test(plugins): expect structured registry differences (#134260)
1 parent 5454da8 commit d27cc02

1 file changed

Lines changed: 15 additions & 9 deletions

File tree

‎src/plugins/status.registry-snapshot.test.ts‎

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -555,16 +555,22 @@ describe("buildPluginRegistrySnapshotReport", () => {
555555
expect(report.workspaceDir).toBe(workspaceDir);
556556
expect(report.workspaceScope).toBe(workspaceScope);
557557
expect(report.registrySource).toBe(state === "persisted" ? "persisted" : "derived");
558+
const expectedRegistryDiagnostic = {
559+
level: state === "missing" ? "info" : "warn",
560+
code: `persisted-registry-${state}`,
561+
message: expect.any(String),
562+
...(state === "stale-source" && {
563+
differences: [
564+
{
565+
pluginId: fixture.pluginId,
566+
persistedSource: fixture.runtimeSource,
567+
derivedSource: fixture.runtimeSource,
568+
},
569+
],
570+
}),
571+
};
558572
expect(report.registryDiagnostics).toEqual(
559-
state === "persisted"
560-
? []
561-
: [
562-
{
563-
level: state === "missing" ? "info" : "warn",
564-
code: `persisted-registry-${state}`,
565-
message: expect.any(String),
566-
},
567-
],
573+
state === "persisted" ? [] : [expectedRegistryDiagnostic],
568574
);
569575
expect(report.diagnostics).toEqual(
570576
workspaceScope === "selected"

0 commit comments

Comments
 (0)