Files
pnpm/pkg-manager/core/test/checkCompatibility.test.ts
Zoltan Kochan 4b80c2c648 fix: do not fail if the active store directory was created by pnpm v9 (#8814)
* fix: do not fail if the active store directory was created by pnpm v9

* test: checkCompatibility
2024-11-28 08:55:19 +01:00

31 lines
842 B
TypeScript

import { LAYOUT_VERSION } from '@pnpm/constants'
import { checkCompatibility } from '../lib/install/checkCompatibility'
test('fail if the store directory changed', () => {
expect(() => {
checkCompatibility({
layoutVersion: LAYOUT_VERSION,
storeDir: '/store/v1',
} as any, // eslint-disable-line
{
storeDir: '/store/v10',
modulesDir: 'node_modules',
virtualStoreDir: 'node_modules/.pnpm',
})
}).toThrow('Unexpected store location')
})
test('do not fail if the store directory is of version 3', () => {
expect(() => {
checkCompatibility({
layoutVersion: LAYOUT_VERSION,
storeDir: '/store/v3',
} as any, // eslint-disable-line
{
storeDir: '/store/v10',
modulesDir: 'node_modules',
virtualStoreDir: 'node_modules/.pnpm',
})
}).not.toThrow()
})