Skip to content

Commit

Permalink
fixed tests according to wanted versions
Browse files Browse the repository at this point in the history
  • Loading branch information
eranturgeman committed Aug 1, 2023
1 parent d38280a commit e07b8ca
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 773 deletions.
2 changes: 1 addition & 1 deletion build/testdata/yarn/v1/project/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "yarn-project",
"name": "build-info-go-tests",
"packageManager": "[email protected]",
"version": "v1.0.0",
"description": "test package for yarn v1",
Expand Down
768 changes: 0 additions & 768 deletions build/testdata/yarn/v2/project/.yarn/releases/yarn-3.1.1.cjs

This file was deleted.

1 change: 0 additions & 1 deletion build/testdata/yarn/v2/project/.yarnrc.yml

This file was deleted.

3 changes: 1 addition & 2 deletions build/testdata/yarn/v2/project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@
},
"devDependencies": {
"json": "9.0.6"
},
"packageManager": "[email protected]"
}
}
2 changes: 1 addition & 1 deletion build/testdata/yarn/v2/project/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Manual changes might be lost - proceed with caution!

__metadata:
version: 5
version: 6
cacheKey: 8

"build-info-go-tests@workspace:.":
Expand Down
5 changes: 5 additions & 0 deletions build/utils/yarn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ func checkGetYarnDependencies(t *testing.T, versionDir string, expectedLocators
Dependencies: map[string]string{"react": "18.2.0", "xml": "1.0.1"},
DevDependencies: map[string]string{"json": "9.0.6"},
}
if versionDir == "v1" {
version, err := GetVersion(executablePath, projectSrcPath)
assert.NoError(t, err, "error has occurred when verifying project's version")
assert.Equal(t, "1.22.19", version, "tests of yarn v1 are not running on v1 project")
}
dependenciesMap, root, err := GetYarnDependencies(executablePath, projectSrcPath, &pacInfo, &utils.NullLog{})

// general checks
Expand Down

0 comments on commit e07b8ca

Please sign in to comment.