Skip to content

Commit

Permalink
fix reading yarn version
Browse files Browse the repository at this point in the history
continuation of #740 with tests added
  • Loading branch information
arjun024 committed Aug 23, 2024
1 parent 8509317 commit 90ef009
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/nodejs/supply/supply.go
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ func (s *Supplier) InstallYarn() error {
}

buffer := new(bytes.Buffer)
if err := s.Command.Execute(s.Stager.BuildDir(), buffer, buffer, "yarn", "--version"); err != nil {
if err := s.Command.Execute(s.Stager.BuildDir(), buffer, buffer, "yarn", "--version", "--loglevel", "notice"); err != nil {
return err
}

Expand Down
6 changes: 3 additions & 3 deletions src/nodejs/supply/supply_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ var _ = Describe("Supply", func() {
BeforeEach(func() {
mockInstaller.EXPECT().InstallOnlyVersion("yarn", yarnInstallDir).Do(installOnlyYarn).Return(nil)

mockCommand.EXPECT().Execute(buildDir, gomock.Any(), gomock.Any(), "yarn", "--version").Do(func(_ string, buffer io.Writer, _ io.Writer, _ string, _ string) {
mockCommand.EXPECT().Execute(buildDir, gomock.Any(), gomock.Any(), "yarn", "--version", "--loglevel", "notice").Do(func(_ string, buffer io.Writer, _ io.Writer, _ string, _ ...string) {
buffer.Write([]byte("0.32.5\n"))
}).Return(nil)
})
Expand Down Expand Up @@ -630,7 +630,7 @@ var _ = Describe("Supply", func() {
mockManifest.EXPECT().AllDependencyVersions("yarn").Return(versions)
mockInstaller.EXPECT().InstallOnlyVersion("yarn", yarnInstallDir).Do(installOnlyYarn).Return(nil)

mockCommand.EXPECT().Execute(buildDir, gomock.Any(), gomock.Any(), "yarn", "--version").Do(func(_ string, buffer io.Writer, _ io.Writer, _ string, _ string) {
mockCommand.EXPECT().Execute(buildDir, gomock.Any(), gomock.Any(), "yarn", "--version", "--loglevel", "notice").Do(func(_ string, buffer io.Writer, _ io.Writer, _ string, _ ...string) {
buffer.Write([]byte("0.32.5\n"))
}).Return(nil)
})
Expand Down Expand Up @@ -661,7 +661,7 @@ var _ = Describe("Supply", func() {

Describe("InstallNPM", func() {
BeforeEach(func() {
mockCommand.EXPECT().Execute(buildDir, gomock.Any(), gomock.Any(), "npm", "--version").Do(func(_ string, buffer io.Writer, _ io.Writer, _ string, _ string) {
mockCommand.EXPECT().Execute(buildDir, gomock.Any(), gomock.Any(), "npm", "--version", "--loglevel", "notice").Do(func(_ string, buffer io.Writer, _ io.Writer, _ string, _ ...string) {
buffer.Write([]byte("1.2.3\n"))
}).Return(nil)
})
Expand Down

0 comments on commit 90ef009

Please sign in to comment.