Files
pnpm/privatePackages/assert-store/test/index.ts
Tejasvi (Teju) Nareddy 2ce8f851b0 chore(assert-store): create new private package @pnpm/assert-store
Add new module to test pnpm stores
Add a test directory

PR #1536
2018-12-07 22:28:42 +02:00

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()
})