Skip to content

Commit

Permalink
Fix previously broken test
Browse files Browse the repository at this point in the history
  • Loading branch information
lumaxis authored Jan 17, 2024
1 parent 4ae722e commit 90d97be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions test/fixtures/scancode/0.0.0/npm-basic.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
"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": {
"href": "urn:npm:npmjs:-:glob:revision:7.1.2:tool:scancode",
"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,
Expand Down
5 changes: 2 additions & 3 deletions test/providers/summary/scancode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`)
}
})

Expand Down

0 comments on commit 90d97be

Please sign in to comment.