From 004953039ed006088132d1336adf6395ccc723df Mon Sep 17 00:00:00 2001 From: Thorarinn Sigurdsson Date: Wed, 24 Feb 2021 10:21:53 +0100 Subject: [PATCH] chore(test): fix flaky watcher test The module names in the event payload here sometimes came out in a different order in CI. Sorting the array should resolve this. --- core/test/unit/src/watch.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/test/unit/src/watch.ts b/core/test/unit/src/watch.ts index 7e8c819f5a..704e0c550d 100644 --- a/core/test/unit/src/watch.ts +++ b/core/test/unit/src/watch.ts @@ -184,12 +184,12 @@ describe("Watcher", () => { it("containing both modules' names when a source file is changed for two co-located modules", async () => { const pathsChanged = [resolve(doubleModulePath, "foo.txt")] emitEvent(garden, "change", pathsChanged[0]) - expect(getEventLog()).to.eql([ - { - name: "moduleSourcesChanged", - payload: { names: ["module-b", "module-c"], pathsChanged }, - }, - ]) + const event = getEventLog()[0] + event.payload.names = event.payload.names.sort() + expect(event).to.eql({ + name: "moduleSourcesChanged", + payload: { names: ["module-b", "module-c"], pathsChanged }, + }) }) })