smartlegal/test/test.ts

18 lines
701 B
TypeScript
Raw Normal View History

2023-10-11 23:21:12 +00:00
import { tap, expect } from '@push.rocks/tapbundle';
import * as legal from '../ts/index.js';
2020-01-17 16:34:40 +00:00
tap.test('should exclude certain licenses', async () => {
const licenseChecker = await legal.createLicenseChecker();
const checkResult = await licenseChecker.excludeLicenseWithinPath(process.cwd(), ['MIT']);
2023-10-11 23:21:12 +00:00
expect(checkResult.failingModules.length).toBeGreaterThan(10);
console.log(checkResult);
2020-01-17 16:34:40 +00:00
});
tap.test('should include certain licenses', async () => {
const licenseChecker = await legal.createLicenseChecker();
const checkResult = await licenseChecker.includeLicencesWithinPath(process.cwd(), ['MIT']);
2023-10-11 23:21:12 +00:00
expect(checkResult.failingModules.length).toBeGreaterThan(10);
2020-01-17 16:34:40 +00:00
});
tap.start();