-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
shasum
when integrity
is not defined
Some npm registries do not define an `integrity` field, in which case we can try using the `shasum` field instead.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -887,6 +887,32 @@ it(`should download yarn berry from custom registry`, async () => { | |
}); | ||
}); | ||
|
||
it(`should download latest pnpm from custom registry`, async () => { | ||
await xfs.mktempPromise(async cwd => { | ||
process.env.AUTH_TYPE = `COREPACK_NPM_TOKEN`; // See `_registryServer.mjs` | ||
process.env.COREPACK_DEFAULT_TO_LATEST = `1`; | ||
process.env.COREPACK_INTEGRITY_KEYS = `0`; | ||
|
||
await xfs.writeJsonPromise(ppath.join(cwd, `package.json` as Filename), { | ||
}); | ||
|
||
await expect(runCli(cwd, [`pnpm`, `--version`], true)).resolves.toMatchObject({ | ||
Check failure on line 899 in tests/main.test.ts GitHub Actions / macos-latest w/ Node.js 22.xtests/main.test.ts > should download latest pnpm from custom registry
Check failure on line 899 in tests/main.test.ts GitHub Actions / macos-latest w/ Node.js 22.xtests/main.test.ts > should download latest pnpm from custom registry
Check failure on line 899 in tests/main.test.ts GitHub Actions / macos-latest w/ Node.js 22.xtests/main.test.ts > should download latest pnpm from custom registry
Check failure on line 899 in tests/main.test.ts GitHub Actions / macos-latest w/ Node.js 18.xtests/main.test.ts > should download latest pnpm from custom registry
Check failure on line 899 in tests/main.test.ts GitHub Actions / macos-latest w/ Node.js 18.xtests/main.test.ts > should download latest pnpm from custom registry
Check failure on line 899 in tests/main.test.ts GitHub Actions / macos-latest w/ Node.js 18.xtests/main.test.ts > should download latest pnpm from custom registry
Check failure on line 899 in tests/main.test.ts GitHub Actions / ubuntu-latest w/ Node.js 22.xtests/main.test.ts > should download latest pnpm from custom registry
Check failure on line 899 in tests/main.test.ts GitHub Actions / ubuntu-latest w/ Node.js 22.xtests/main.test.ts > should download latest pnpm from custom registry
Check failure on line 899 in tests/main.test.ts GitHub Actions / ubuntu-latest w/ Node.js 22.xtests/main.test.ts > should download latest pnpm from custom registry
Check failure on line 899 in tests/main.test.ts GitHub Actions / macos-latest w/ Node.js 20.xtests/main.test.ts > should download latest pnpm from custom registry
Check failure on line 899 in tests/main.test.ts GitHub Actions / macos-latest w/ Node.js 20.xtests/main.test.ts > should download latest pnpm from custom registry
Check failure on line 899 in tests/main.test.ts GitHub Actions / macos-latest w/ Node.js 20.xtests/main.test.ts > should download latest pnpm from custom registry
Check failure on line 899 in tests/main.test.ts GitHub Actions / macos-latest w/ Node.js 21.xtests/main.test.ts > should download latest pnpm from custom registry
Check failure on line 899 in tests/main.test.ts GitHub Actions / macos-latest w/ Node.js 21.xtests/main.test.ts > should download latest pnpm from custom registry
Check failure on line 899 in tests/main.test.ts GitHub Actions / macos-latest w/ Node.js 21.xtests/main.test.ts > should download latest pnpm from custom registry
Check failure on line 899 in tests/main.test.ts GitHub Actions / ubuntu-latest w/ Node.js 18.xtests/main.test.ts > should download latest pnpm from custom registry
Check failure on line 899 in tests/main.test.ts GitHub Actions / ubuntu-latest w/ Node.js 18.xtests/main.test.ts > should download latest pnpm from custom registry
Check failure on line 899 in tests/main.test.ts GitHub Actions / ubuntu-latest w/ Node.js 18.xtests/main.test.ts > should download latest pnpm from custom registry
Check failure on line 899 in tests/main.test.ts GitHub Actions / ubuntu-latest w/ Node.js 20.xtests/main.test.ts > should download latest pnpm from custom registry
Check failure on line 899 in tests/main.test.ts GitHub Actions / ubuntu-latest w/ Node.js 20.xtests/main.test.ts > should download latest pnpm from custom registry
Check failure on line 899 in tests/main.test.ts GitHub Actions / ubuntu-latest w/ Node.js 20.xtests/main.test.ts > should download latest pnpm from custom registry
Check failure on line 899 in tests/main.test.ts GitHub Actions / ubuntu-latest w/ Node.js 21.xtests/main.test.ts > should download latest pnpm from custom registry
Check failure on line 899 in tests/main.test.ts GitHub Actions / ubuntu-latest w/ Node.js 21.xtests/main.test.ts > should download latest pnpm from custom registry
Check failure on line 899 in tests/main.test.ts GitHub Actions / ubuntu-latest w/ Node.js 21.xtests/main.test.ts > should download latest pnpm from custom registry
Check failure on line 899 in tests/main.test.ts GitHub Actions / windows-latest w/ Node.js 22.xtests/main.test.ts > should download latest pnpm from custom registry
Check failure on line 899 in tests/main.test.ts GitHub Actions / windows-latest w/ Node.js 22.xtests/main.test.ts > should download latest pnpm from custom registry
Check failure on line 899 in tests/main.test.ts GitHub Actions / windows-latest w/ Node.js 22.xtests/main.test.ts > should download latest pnpm from custom registry
Check failure on line 899 in tests/main.test.ts GitHub Actions / windows-latest w/ Node.js 20.xtests/main.test.ts > should download latest pnpm from custom registry
Check failure on line 899 in tests/main.test.ts GitHub Actions / windows-latest w/ Node.js 20.xtests/main.test.ts > should download latest pnpm from custom registry
Check failure on line 899 in tests/main.test.ts GitHub Actions / windows-latest w/ Node.js 20.xtests/main.test.ts > should download latest pnpm from custom registry
Check failure on line 899 in tests/main.test.ts GitHub Actions / windows-latest w/ Node.js 21.xtests/main.test.ts > should download latest pnpm from custom registry
Check failure on line 899 in tests/main.test.ts GitHub Actions / windows-latest w/ Node.js 21.xtests/main.test.ts > should download latest pnpm from custom registry
Check failure on line 899 in tests/main.test.ts GitHub Actions / windows-latest w/ Node.js 21.xtests/main.test.ts > should download latest pnpm from custom registry
Check failure on line 899 in tests/main.test.ts GitHub Actions / windows-latest w/ Node.js 18.xtests/main.test.ts > should download latest pnpm from custom registry
Check failure on line 899 in tests/main.test.ts GitHub Actions / windows-latest w/ Node.js 18.xtests/main.test.ts > should download latest pnpm from custom registry
Check failure on line 899 in tests/main.test.ts GitHub Actions / windows-latest w/ Node.js 18.xtests/main.test.ts > should download latest pnpm from custom registry
|
||
exitCode: 0, | ||
stdout: `pnpm: Hello from custom registry\n`, | ||
stderr: | ||
`! The local project doesn't define a 'packageManager' field. Corepack will now add one referencing [email protected]+sha1.d862ca5bedaa7d2328b8bde6ce2bac5141681f48.\n` + | ||
`! For more details about this field, consult the documentation at https://nodejs.org/api/packages.html#packagemanager\n`, | ||
}); | ||
|
||
// Should keep working with cache | ||
await expect(runCli(cwd, [`pnpm`, `--version`])).resolves.toMatchObject({ | ||
exitCode: 0, | ||
stdout: `pnpm: Hello from custom registry\n`, | ||
stderr: ``, | ||
}); | ||
}); | ||
}); | ||
|
||
for (const authType of [`COREPACK_NPM_REGISTRY`, `COREPACK_NPM_TOKEN`, `COREPACK_NPM_PASSWORD`, `PROXY`]) { | ||
describe(`custom registry with auth ${authType}`, () => { | ||
beforeEach(() => { | ||
|