Skip to content

Commit 174232e

Browse files
committed
tests
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent 3f2bf42 commit 174232e

File tree

2 files changed

+9
-19
lines changed

2 files changed

+9
-19
lines changed

src/utils/licenseUtility.node.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,5 @@ export class LicenseEvidenceGatherer<P extends string = string> {
9898
}
9999
}
100100

101-
102-
103-
/* c8 ignore next 2 */
104101
/* eslint-disable-next-line @typescript-eslint/no-empty-function -- ack */
105102
function noop ():void {}

tests/integration/Utils.LicenseUtility.LicenseEvidenceGatherer.node.test.js

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,13 @@ suite('integration: Utils.LicenseUtility.LicenseEvidenceGatherer', () => {
3434
const { fs } = memfs({ '/': {} })
3535
const leg = new LicenseEvidenceGatherer({ fs })
3636
assert.throws(
37-
() => { Array.from(leg.getFileAttachments('/foo')) },
37+
() => {
38+
Array.from(
39+
leg.getFileAttachments('/foo'))
40+
},
3841
{
3942
code: 'ENOENT',
40-
message: 'ENOENT: no such file or directory, scandir \'/foo\'',
43+
message: "ENOENT: no such file or directory, scandir '/foo'",
4144
path: '/foo',
4245
}
4346
)
@@ -63,14 +66,9 @@ suite('integration: Utils.LicenseUtility.LicenseEvidenceGatherer', () => {
6366
'/LICENSE/GPL-3.0-or-later.txt': 'GPL-3.0-or-later License text here...'
6467
})
6568
const leg = new LicenseEvidenceGatherer({ fs })
66-
const errors = []
6769
const found = Array.from(
68-
leg.getFileAttachments(
69-
'/',
70-
(e) => { errors.push(e) }
71-
))
70+
leg.getFileAttachments('/'))
7271
assert.deepEqual(found, [])
73-
assert.deepEqual(errors, [])
7472
})
7573

7674
test('ignore LICENSES folder', () => {
@@ -80,14 +78,9 @@ suite('integration: Utils.LicenseUtility.LicenseEvidenceGatherer', () => {
8078
'/LICENSES/GPL-3.0-or-later.txt': 'GPL-3.0-or-later License text here...'
8179
})
8280
const leg = new LicenseEvidenceGatherer({ fs })
83-
const errors = []
8481
const found = Array.from(
85-
leg.getFileAttachments(
86-
'/',
87-
(e) => { errors.push(e) }
88-
))
82+
leg.getFileAttachments('/'))
8983
assert.deepEqual(found, [])
90-
assert.deepEqual(errors, [])
9184
})
9285

9386
test('reports unreadable files', () => {
@@ -118,10 +111,10 @@ suite('integration: Utils.LicenseUtility.LicenseEvidenceGatherer', () => {
118111
'/UNLICENSE': 'UNLICENSE file expected',
119112
'/UNLICENCE': 'UNLICENCE file expected',
120113
'/NOTICE': 'NOTICE file expected',
121-
'/-some-.licenses-below': 'unexpected file',
114+
'/---some-.licenses-below': 'unexpected file',
122115
'/MIT.license': 'MIT.license file expected',
123116
'/MIT.licence': 'MIT.licence file expected',
124-
'/-some-licenses.-below': 'unexpected file',
117+
'/---some-licenses.-below': 'unexpected file',
125118
'/license.mit': 'license.mit file expected',
126119
'/license.txt': 'license.txt file expected',
127120
'/license.js': 'license.js file unexpected',

0 commit comments

Comments
 (0)