-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathcopyleft.spec.ts
More file actions
26 lines (23 loc) · 1.07 KB
/
copyleft.spec.ts
File metadata and controls
26 lines (23 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import child_process from 'node:child_process';
describe('license-kit copyleft', () => {
it('should report error for strong copyleft licenses', async () => {
const output = await new Promise<string>((resolve) => {
child_process.exec('yarn workspace license-kit-node-example copyleft', (_, __, stderr) => {
resolve(stderr);
});
});
expect(output).toMatch('Copyleft licenses found in the following dependencies:');
expect(output).toMatch('dhtmlx-gantt: GPL-2.0');
});
it('should report error for strong and weak copyleft licenses', async () => {
const output = await new Promise<string>((resolve) => {
child_process.exec('yarn workspace license-kit-node-example weak-copyleft', (_, __, stderr) => {
resolve(stderr);
});
});
expect(output).toMatch('Copyleft licenses found in the following dependencies:');
expect(output).toMatch('dhtmlx-gantt: GPL-2.0');
expect(output).toMatch('Weak copyleft licenses found in the following dependencies:');
expect(output).toMatch('mariadb: LGPL-2.1-or-later');
});
});