mirror of
https://github.com/pnpm/pnpm.git
synced 2026-05-24 16:46:06 -04:00
25 lines
803 B
TypeScript
25 lines
803 B
TypeScript
import assertStore from '@pnpm/assert-store'
|
|
import path = require('path')
|
|
import test = require('tape')
|
|
|
|
test('assertStore() store assertions', async (t) => {
|
|
const storePath = path.join(__dirname, 'fixture/store/2/')
|
|
const encodedRegistryName = 'registry.npmjs.org'
|
|
const store = assertStore(t, storePath, encodedRegistryName)
|
|
|
|
await store.storeHas('is-positive', '3.1.0')
|
|
await store.storeHasNot('ansi-regex', '2.0.0')
|
|
await store.storeHasNot('is-positive', '2.0.0')
|
|
|
|
t.end()
|
|
})
|
|
|
|
test('assertStore() resolve', async (t) => {
|
|
const storePath = path.join(__dirname, 'fixture/store/2/')
|
|
const encodedRegistryName = 'registry.npmjs.org'
|
|
const store = assertStore(t, storePath, encodedRegistryName)
|
|
|
|
t.equal(typeof await store.resolve('is-positive', '3.1.0'), 'string')
|
|
t.end()
|
|
})
|