smartnpm/test/test.ts

23 lines
621 B
TypeScript
Raw Permalink Normal View History

2017-08-14 15:50:48 +00:00
import { expect, tap } from 'tapbundle'
import * as smartnpm from '../ts/index'
2017-08-15 15:03:21 +00:00
let testRegistry: smartnpm.NpmRegistry
let testPackage: smartnpm.NpmPackage
tap.test('should create valid instances', async () => {
testRegistry = new smartnpm.NpmRegistry()
expect(testRegistry).to.be.instanceof(smartnpm.NpmRegistry)
testPackage = new smartnpm.NpmPackage({})
expect(testPackage).to.be.instanceof(smartnpm.NpmPackage)
})
tap.test('should produce a valid search string', async () => {
let packages = await testRegistry.search({
name: 'npmts'
})
expect(packages[0].name).to.equal('npmts')
2017-08-14 15:50:48 +00:00
})
tap.start()