Skip to content

Commit

Permalink
Merge pull request #79 from qtomlinson/qt/fix_comparison
Browse files Browse the repository at this point in the history
Improve definition comparison
  • Loading branch information
qtomlinson authored Jun 10, 2024
2 parents 7a47b07 + b3391a3 commit f8cff80
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tools/integration/test/e2e-test-service/definitionTest.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// (c) Copyright 2024, SAP SE and ClearlyDefined contributors. Licensed under the MIT license.
// SPDX-License-Identifier: MIT

const { omit, isEqual } = require('lodash')
const { omit, isEqual, pick } = require('lodash')
const { deepStrictEqual, strictEqual } = require('assert')
const { callFetch, buildPostOpts } = require('../../lib/fetch')
const { devApiBaseUrl, prodApiBaseUrl, expectedResponses, components, definition } = require('../testConfig')
Expand Down Expand Up @@ -77,14 +77,16 @@ function compareDefinition(recomputedDef, expectedDef) {
}

function compareLicensed(result, expectation) {
const actual = omit(result.licensed, ['facets'])
let actual = omit(result.licensed, ['facets'])
const expected = omit(expectation.licensed, ['facets'])
actual = pick(actual, Object.keys(expected))
deepStrictEqual(actual, expected)
}

function compareDescribed(result, expectation) {
const actual = omit(result.described, ['tools'])
let actual = omit(result.described, ['tools'])
const expected = omit(expectation.described, ['tools'])
actual = pick(actual, Object.keys(expected))
deepStrictEqual(actual, expected)
}

Expand Down

0 comments on commit f8cff80

Please sign in to comment.