Files
pnpm/pkg-manager/core/test/checkCompatibility.test.ts
Zoltan Kochan 1c8c4e49f5 style: add eslint-plugin-simple-import-sort (#10947)
Add eslint-plugin-simple-import-sort to enforce consistent import ordering:
- Node.js builtins first
- External packages second
- Relative imports last
- Named imports sorted alphabetically within each statement
2026-03-13 02:02:38 +01:00

32 lines
852 B
TypeScript

import { LAYOUT_VERSION } from '@pnpm/constants'
import { checkCompatibility } from '../lib/install/checkCompatibility/index.js'
test('fail if the store directory changed', () => {
expect(() => {
checkCompatibility({
layoutVersion: LAYOUT_VERSION,
storeDir: '/store/v1',
} as any, // eslint-disable-line
{
storeDir: '/store/v11',
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/v11',
modulesDir: 'node_modules',
virtualStoreDir: 'node_modules/.pnpm',
})
}).not.toThrow()
})