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)
|
|
|
|
})
|
|
|
|
|
2018-02-14 22:51:08 +00:00
|
|
|
tap.test('should produce a valid search string and this return npmts', async () => {
|
2017-08-15 15:03:21 +00:00
|
|
|
let packages = await testRegistry.search({
|
|
|
|
name: 'npmts'
|
|
|
|
})
|
|
|
|
expect(packages[0].name).to.equal('npmts')
|
2017-08-14 15:50:48 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
tap.start()
|