From 90d97bea0ed49b73f6c89aacae83f9a8c8189af4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Spie=C3=9F?= Date: Fri, 12 Jan 2024 12:56:31 +0000 Subject: [PATCH] Fix previously broken test --- test/fixtures/scancode/0.0.0/npm-basic.json | 6 +++--- test/providers/summary/scancode.js | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/test/fixtures/scancode/0.0.0/npm-basic.json b/test/fixtures/scancode/0.0.0/npm-basic.json index 63cd0fc4b..eaa9ccd4d 100644 --- a/test/fixtures/scancode/0.0.0/npm-basic.json +++ b/test/fixtures/scancode/0.0.0/npm-basic.json @@ -5,7 +5,7 @@ "fetchedAt": "2018-02-27T20:03:11.607Z", "links": { "self": { - "href": "urn:npm:npmjs:-:glob:revision:7.1.2:tool:scancode:2.2.1", + "href": "urn:npm:npmjs:-:glob:revision:7.1.2:tool:scancode:0.0.0", "type": "resource" }, "siblings": { @@ -13,14 +13,14 @@ "type": "collection" } }, - "version": "2.2.1", + "version": "0.0.0", "contentType": "application/json", "releaseDate": "2017-05-19T20:15:25.471Z", "processedAt": "2018-02-27T20:05:25.944Z" }, "content": { "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", - "scancode_version": "2.2.1", + "scancode_version": "0.0.0", "scancode_options": { "--copyright": true, "--license": true, diff --git a/test/providers/summary/scancode.js b/test/providers/summary/scancode.js index f00ec9f40..fe3c760ed 100644 --- a/test/providers/summary/scancode.js +++ b/test/providers/summary/scancode.js @@ -110,15 +110,14 @@ describe('ScancodeSummarizer basic compatability', () => { assert.equal(result.licensed.declared, 'BSD-2-Clause AND CC0-1.0 OR BSD-2-Clause') }) - it('throws an error on an invalid scancode version', () => { + it.only('throws an error on an invalid scancode version', () => { const version = '0.0.0' const coordinates = { type: 'npm', provider: 'npmjs' } const harvestData = getHarvestData(version, 'npm-basic') try { summarizer.summarize(coordinates, harvestData) - throw new Error('Invalid version of ScanCode') } catch (error) { - expect(error.message).to.eq('Invalid version of ScanCode') + expect(error.message).to.eq(`Invalid version of ScanCode: ${version}`) } })