Files
pnpm/cli/cli-meta/test/getCurrentPackageName.test.ts
Zoltan Kochan 4d23d7db38 fix: self-update should install @pnpm/exe when running as executable
Revert the workaround that forced `pnpm self-update` to always install
the `pnpm` package for v11+. Since `@pnpm/exe` works again from
v11.0.0-alpha.7, `getCurrentPackageName()` now simply returns
`@pnpm/exe` when running as an executable, without platform-specific
package names.
2026-02-22 23:46:23 +01:00

24 lines
531 B
TypeScript

import { getCurrentPackageName } from '@pnpm/cli-meta'
test('getCurrentPackageName()', () => {
expect(getCurrentPackageName({
platform: 'darwin',
arch: 'arm64',
})).toBe('pnpm')
expect(getCurrentPackageName({
pkg: '.',
platform: 'win32',
arch: 'ia32',
})).toBe('@pnpm/exe')
expect(getCurrentPackageName({
pkg: '.',
platform: 'darwin',
arch: 'arm64',
})).toBe('@pnpm/exe')
expect(getCurrentPackageName({
pkg: '.',
platform: 'linux',
arch: 'x64',
})).toBe('@pnpm/exe')
})