Files
pnpm/__utils__/assert-store/test/index.ts
2025-08-25 10:02:00 +02:00

23 lines
876 B
TypeScript

/// <reference path="../../../__typings__/index.d.ts"/>
import path from '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')
})