Files
smartnpm/test/test.ts

23 lines
643 B
TypeScript
Raw Normal View History

2017-08-14 17:50:48 +02:00
import { expect, tap } from 'tapbundle'
import * as smartnpm from '../ts/index'
2017-08-15 17:03:21 +02: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 23:51:08 +01:00
tap.test('should produce a valid search string and this return npmts', async () => {
2017-08-15 17:03:21 +02:00
let packages = await testRegistry.search({
name: 'npmts'
})
expect(packages[0].name).to.equal('npmts')
2017-08-14 17:50:48 +02:00
})
tap.start()