smartnpm/test/test.ts

23 lines
667 B
TypeScript
Raw Normal View History

2018-09-01 14:40:42 +00:00
import { expect, tap } from '@pushrocks/tapbundle';
import * as smartnpm from '../ts/index';
2017-08-14 15:50:48 +00:00
2018-09-01 14:40:42 +00:00
let testRegistry: smartnpm.NpmRegistry;
let testPackage: smartnpm.NpmPackage;
2017-08-15 15:03:21 +00:00
tap.test('should create valid instances', async () => {
2018-09-01 14:40:42 +00:00
testRegistry = new smartnpm.NpmRegistry();
expect(testRegistry).to.be.instanceof(smartnpm.NpmRegistry);
2017-08-15 15:03:21 +00:00
2018-09-01 14:40:42 +00:00
testPackage = new smartnpm.NpmPackage({});
expect(testPackage).to.be.instanceof(smartnpm.NpmPackage);
});
2017-08-15 15:03:21 +00:00
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'
2018-09-01 14:40:42 +00:00
});
expect(packages[0].name).to.equal('npmts');
});
2017-08-14 15:50:48 +00:00
2018-09-01 14:40:42 +00:00
tap.start();