diff --git a/core/test/unit/src/commands/link.ts b/core/test/unit/src/commands/link.ts index e28d815966..c3ca93536f 100644 --- a/core/test/unit/src/commands/link.ts +++ b/core/test/unit/src/commands/link.ts @@ -56,7 +56,12 @@ describe("LinkCommand", () => { const linkedModuleSources = await garden.configStore.get("linkedModuleSources") - expect(linkedModuleSources).to.eql([{ name: "module-a", path: localModulePath }]) + expect(linkedModuleSources).to.eql({ + "module-a": { + name: "module-a", + path: localModulePath, + }, + }) }) it("should handle relative paths", async () => { @@ -76,7 +81,12 @@ describe("LinkCommand", () => { const linkedModuleSources = await garden.configStore.get("linkedModuleSources") - expect(linkedModuleSources).to.eql([{ name: "module-a", path: localModulePath }]) + expect(linkedModuleSources).to.eql({ + "module-a": { + name: "module-a", + path: localModulePath, + }, + }) }) it("should throw if module to link does not have an external source", async () => { @@ -155,7 +165,12 @@ describe("LinkCommand", () => { const linkedProjectSources = await garden.configStore.get("linkedProjectSources") - expect(linkedProjectSources).to.eql([{ name: "source-a", path: localSourcePath }]) + expect(linkedProjectSources).to.eql({ + "source-a": { + name: "source-a", + path: localSourcePath, + }, + }) }) it("should handle relative paths", async () => { @@ -166,14 +181,19 @@ describe("LinkCommand", () => { footerLog: log, args: { source: "source-a", - path: join("..", "test-project-local-project-sources", `source-a`), + path: join("..", "test-project-local-project-sources"), }, opts: withDefaultGlobalOpts({}), }) const linkedProjectSources = await garden.configStore.get("linkedProjectSources") - expect(linkedProjectSources).to.eql([{ name: "source-a", path: localSourcePath }]) + expect(linkedProjectSources).to.eql({ + "source-a": { + name: "source-a", + path: localSourcePath, + }, + }) }) it("should return linked sources", async () => { diff --git a/core/test/unit/src/commands/unlink.ts b/core/test/unit/src/commands/unlink.ts index 2bf2fcc436..7cd00d47b1 100644 --- a/core/test/unit/src/commands/unlink.ts +++ b/core/test/unit/src/commands/unlink.ts @@ -89,7 +89,12 @@ describe("UnlinkCommand", () => { opts: withDefaultGlobalOpts({ all: false }), }) const linkedModuleSources = await garden.configStore.get("linkedModuleSources") - expect(linkedModuleSources).to.eql([{ name: "module-c", path: linkedModulePathC }]) + expect(linkedModuleSources).to.eql({ + "module-c": { + name: "module-c", + path: linkedModulePathC, + }, + }) }) it("should unlink all modules", async () => { @@ -102,7 +107,7 @@ describe("UnlinkCommand", () => { opts: withDefaultGlobalOpts({ all: true }), }) const linkedModuleSources = await garden.configStore.get("linkedModuleSources") - expect(linkedModuleSources).to.eql([]) + expect(linkedModuleSources).to.eql({}) }) }) @@ -168,7 +173,12 @@ describe("UnlinkCommand", () => { opts: withDefaultGlobalOpts({ all: false }), }) const linkedProjectSources = await garden.configStore.get("linkedProjectSources") - expect(linkedProjectSources).to.eql([{ name: "source-c", path: linkedSourcePathC }]) + expect(linkedProjectSources).to.eql({ + "source-c": { + name: "source-c", + path: linkedSourcePathC, + }, + }) }) it("should unlink all sources", async () => { @@ -181,7 +191,7 @@ describe("UnlinkCommand", () => { opts: withDefaultGlobalOpts({ all: true }), }) const linkedProjectSources = await garden.configStore.get("linkedProjectSources") - expect(linkedProjectSources).to.eql([]) + expect(linkedProjectSources).to.eql({}) }) }) })