Skip to content

Comments

fix(tests): enable JS functional tests for CycloneDX 2.0#836

Open
Mehrn0ush wants to merge 1 commit intoCycloneDX:2.0-devfrom
Mehrn0ush:fix/tests-js-functional-2.0
Open

fix(tests): enable JS functional tests for CycloneDX 2.0#836
Mehrn0ush wants to merge 1 commit intoCycloneDX:2.0-devfrom
Mehrn0ush:fix/tests-js-functional-2.0

Conversation

@Mehrn0ush
Copy link
Contributor

What

Fixes the JS functional test harness for CycloneDX 2.0:

  • Resolve the correct 2.0 schema (schema/2.0/cyclonedx-2.0-bundled.schema.json) when running -v 2.0.
  • Use the Ajv 2020-12 build for 2.0 schemas.
  • Register referenced schemas under both http and https IDs to avoid ref resolution mismatches.
  • Align 2.0 cryptography "valid-*" test vectors with the bundled schema by wrapping single values in one-element arrays:
    • components[].cryptoProperties.algorithmProperties.implementationPlatform
    • components[].cryptoProperties.securedBy[].algorithmRef

Why

node tools/src/test/js/json-schema-functional-tests.js -v 2.0 previously failed due to:

  • outdated schema path assumptions (schema/bom-2.0.schema.json)
  • missing draft 2020-12 meta-schema support in Ajv
  • a small mismatch in 2.0 cryptography test vectors where the schema expects arrays

Testing

  • cd tools/src/test/js && npm install && npm test
  • node json-schema-functional-tests.js -v 2.0

Closes #835

Signed-off-by: Mehrn0ush <mehrnoush.vaseghi@gmail.com>
@Mehrn0ush Mehrn0ush requested a review from a team as a code owner February 21, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant