mirror of
https://github.com/pnpm/pnpm.git
synced 2026-03-28 12:01:37 -04:00
23 lines
876 B
TypeScript
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')
|
|
})
|