fix(core): initial

This commit is contained in:
2020-01-17 16:34:40 +00:00
commit 083bc51530
11 changed files with 3512 additions and 0 deletions

23
test/test.ts Normal file
View File

@ -0,0 +1,23 @@
import { tap, expect } from '@pushrocks/tapbundle';
import * as legal from '../ts/index';
tap.test('should create instance of licenseChecker', async () => {
const licenseChecker = await legal.createLicenseChecker();
let plainResultArray = await licenseChecker.createPlainResultArray(process.cwd());
expect(plainResultArray).to.be.instanceof(Array);
expect(plainResultArray[0]).to.have.property('license');
});
tap.test('should exclude certain licenses', async () => {
const licenseChecker = await legal.createLicenseChecker();
const checkResult = await licenseChecker.excludeLicenseWithinPath(process.cwd(), ['MIT']);
expect(checkResult.failingModules.length).to.be.greaterThan(10);
});
tap.test('should include certain licenses', async () => {
const licenseChecker = await legal.createLicenseChecker();
const checkResult = await licenseChecker.includeLicencesWithinPath(process.cwd(), ['MIT']);
expect(checkResult.failingModules.length).to.be.greaterThan(10);
});
tap.start();