Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add additional npm: dependency lockfile tests #1854

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions e2e/pnpm_lockfiles/base/aliases-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,22 @@ if (
)
}

// `is-odd` and the aliased `is-odd-alt-version` should be different versions
// `is-odd` and the aliased `is-odd-alias` should be different versions
if (
require('is-odd/package.json').version ===
require('is-odd-alt-version/package.json').version
require('is-odd/package.json').version !== '3.0.1' ||
require('is-odd/package.json').version !==
require('is-odd-alias/package.json').version
) {
throw new Error('aliased `is-odd` as `is-odd-alt-version` are the same')
throw new Error('aliased `is-odd` as `is-odd-alias` should be the same')
}

if (
require('is-odd-v0/package.json').version[0] !== '0' ||
require('is-odd-v1/package.json').version[0] !== '1' ||
require('is-odd-v2/package.json').version[0] !== '2' ||
require('is-odd-v3/package.json').version[0] !== '3'
) {
throw new Error('aliased `is-odd-v#` should have the correct version')
}

// `@isaacs/cliui` has transitive `npm:*` deps
Expand Down
6 changes: 5 additions & 1 deletion e2e/pnpm_lockfiles/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
"typescript": "^5.4.5",
"meaning-of-life": "1.0.0",
"is-odd": "npm:is-odd@3.0.1",
"is-odd-alt-version": "npm:is-odd@^2.0.0",
"is-odd-alias": "npm:is-odd",
"is-odd-v0": "npm:is-odd@0.1.0",
"is-odd-v1": "npm:is-odd@1.0.0",
"is-odd-v2": "npm:is-odd@2.0.0",
"is-odd-v3": "npm:is-odd@3.0.0",
"uvu": "0.5.6",
"@scoped/a": "workspace:*",
"@scoped/b": "link:../projects/b",
Expand Down
15 changes: 13 additions & 2 deletions e2e/pnpm_lockfiles/lockfile-test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ def lockfile_test(name = None):
":node_modules/alias-only-sizzle",
":node_modules/alias-types-node",
":node_modules/is-odd",
":node_modules/is-odd-alt-version",
":node_modules/is-odd-alias",
":node_modules/is-odd-v0",
":node_modules/is-odd-v1",
":node_modules/is-odd-v2",
":node_modules/is-odd-v3",
":node_modules/@isaacs/cliui",
],
entry_point = "aliases-test.js",
Expand Down Expand Up @@ -116,9 +120,16 @@ def lockfile_test(name = None):
":node_modules/@aspect-test/a2",
# npm: alias to registry-scoped packages
":node_modules/alias-types-node",
":node_modules/is-odd-alias",
# npm: alias to alternate versions
":node_modules/is-odd-alt-version",
":node_modules/is-odd-v0",
":node_modules/is-odd-v1",
":node_modules/is-odd-v2",
":node_modules/is-odd-v3",
":.aspect_rules_js/node_modules/is-odd@0.1.0",
":.aspect_rules_js/node_modules/is-odd@1.0.0",
":.aspect_rules_js/node_modules/is-odd@2.0.0",
":.aspect_rules_js/node_modules/is-odd@3.0.0",

# npm: alias to package not listed elsewhere
":node_modules/alias-only-sizzle",
Expand Down
39 changes: 34 additions & 5 deletions e2e/pnpm_lockfiles/v54/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

118 changes: 68 additions & 50 deletions e2e/pnpm_lockfiles/v54/snapshots/defs.bzl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading