diff --git a/install_process.go b/install_process.go index 89ae741e..558a8344 100644 --- a/install_process.go +++ b/install_process.go @@ -78,7 +78,7 @@ func (ip YarnInstallProcess) ShouldRun(workingDir string, metadata map[string]in return true, "", fmt.Errorf("failed to write temp file for %s: %w", file.Name(), err) } - sum, err := ip.summer.Sum(filepath.Join(workingDir, "yarn.lock"), file.Name()) + sum, err := ip.summer.Sum(filepath.Join(workingDir, "yarn.lock"), filepath.Join(workingDir, "package.json"), file.Name()) if err != nil { return true, "", fmt.Errorf("unable to sum config files: %w", err) } diff --git a/install_process_test.go b/install_process_test.go index ab0e92b4..4d68b7e6 100644 --- a/install_process_test.go +++ b/install_process_test.go @@ -79,7 +79,8 @@ func testInstallProcess(t *testing.T, context spec.G, it spec.S) { "cache_sha": "some-sha", }) Expect(summer.SumCall.Receives.Paths[0]).To(Equal(filepath.Join(workingDir, "yarn.lock"))) - Expect(summer.SumCall.Receives.Paths[1]).To(ContainSubstring("config-file")) + Expect(summer.SumCall.Receives.Paths[1]).To(Equal(filepath.Join(workingDir, "package.json"))) + Expect(summer.SumCall.Receives.Paths[2]).To(ContainSubstring("config-file")) Expect(run).To(BeTrue()) Expect(sha).To(Equal("some-other-sha")) Expect(err).NotTo(HaveOccurred())