Skip to content

Commit

Permalink
fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eranturgeman committed Aug 1, 2023
1 parent e07b8ca commit 73df1a7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion build/utils/yarn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,14 @@ func checkGetYarnDependenciesUninstalled(t *testing.T, versionToSet string) {
lockFilePath := filepath.Join(projectSrcPath, "yarn.lock")
yarnLockFile, err := os.OpenFile(lockFilePath, os.O_WRONLY|os.O_TRUNC, 0666)
assert.NoError(t, err, "could not open yarn.lock file or could not truncate the file's content")
defer yarnLockFile.Close()
defer func() {
assert.NoError(t, yarnLockFile.Close())
}()

pacInfo := PackageInfo{Name: "build-info-go-tests"}
_, _, err = GetYarnDependencies(executablePath, projectSrcPath, &pacInfo, &utils.NullLog{})
assert.Error(t, err)
assert.True(t, strings.Contains(err.Error(), "fetching dependencies failed since '"+pacInfo.Name+"' doesn't present in your lockfile\nPlease run 'yarn install' to update lockfile\n"))
}

func updateDirYarnVersion(executablePath string, srcPath string, versionToSet string) (err error) {
Expand Down

0 comments on commit 73df1a7

Please sign in to comment.