Files
pnpm/__utils__/assert-store/test/index.ts
Zoltan Kochan 5d5818e44f style: enforce node: protocol for builtin imports (#10951)
Add n/prefer-node-protocol rule and autofix all bare builtin imports
to use the node: prefix. Simplify the simple-import-sort builtins
pattern to just ^node: since all imports now use the prefix.
2026-03-13 07:59:51 +01:00

24 lines
882 B
TypeScript

/// <reference path="../../../__typings__/index.d.ts"/>
import path from 'node:path'
import { assertStore } from '@pnpm/assert-store'
import { STORE_VERSION } from '@pnpm/constants'
test('assertStore() store assertions', async () => {
const storePath = path.join(import.meta.dirname, `fixture/store/${STORE_VERSION}/`)
const encodedRegistryName = 'registry.npmjs.org'
const store = assertStore(storePath, encodedRegistryName)
store.storeHas('is-positive', '3.1.0')
store.storeHasNot('ansi-regex', '2.0.0')
store.storeHasNot('is-positive', '2.0.0')
})
test('assertStore() resolve', async () => {
const storePath = path.join(import.meta.dirname, `fixture/store/${STORE_VERSION}/`)
const encodedRegistryName = 'registry.npmjs.org'
const store = assertStore(storePath, encodedRegistryName)
expect(typeof store.resolve('is-positive', '3.1.0')).toBe('string')
})