Skip to content

Commit 486f867

Browse files
Attempting to resolve unit tests
Signed-off-by: Steve Springett <steve@springett.us>
1 parent b1a254b commit 486f867

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

tools/src/test/js/json-schema-functional-tests.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ console.debug('DEBUG | testdataDir = ', testdataDir);
4444

4545
// region validator
4646

47-
const [spdxSchema, jsfSchema, bomSchema] = await Promise.all([
47+
const [spdxSchema, jsfSchema, cryptoDefsSchema, bomSchema] = await Promise.all([
4848
readFile(join(schemaDir, 'spdx.schema.json'), 'utf-8').then(JSON.parse),
4949
readFile(join(schemaDir, 'jsf-0.82.schema.json'), 'utf-8').then(JSON.parse),
50+
readFile(join(schemaDir, 'cryptography-defs.schema.json'), 'utf-8').then(JSON.parse),
5051
readFile(schemaFile, 'utf-8').then(JSON.parse)
5152
])
5253

@@ -57,7 +58,8 @@ const ajv = new Ajv({
5758
addUsedSchema: false,
5859
schemas: {
5960
'http://cyclonedx.org/schema/spdx.schema.json': spdxSchema,
60-
'http://cyclonedx.org/schema/jsf-0.82.schema.json': jsfSchema
61+
'http://cyclonedx.org/schema/jsf-0.82.schema.json': jsfSchema,
62+
'http://cyclonedx.org/schema/cryptography-defs.schema.json': cryptoDefsSchema
6163
}
6264
});
6365
addFormats(ajv)

tools/src/test/js/json-schema-lint-tests.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ const schemaDir = join(dirname(fileURLToPath(import.meta.url)), '..', '..', '..'
1717

1818
// endregion config
1919

20-
const [spdxSchema, jsfSchema, bomSchemas] = await Promise.all([
20+
const [spdxSchema, jsfSchema, cryptoDefsSchema, bomSchemas] = await Promise.all([
2121
readFile(join(schemaDir, 'spdx.schema.json'), 'utf-8').then(JSON.parse),
2222
readFile(join(schemaDir, 'jsf-0.82.schema.json'), 'utf-8').then(JSON.parse),
23+
readFile(join(schemaDir, 'cryptography-defs.schema.json'), 'utf-8').then(JSON.parse),
2324
glob(join(schemaDir, bomSchemasGlob)).then(l => l.sort())
2425
])
2526
assert.notStrictEqual(bomSchemas.length, 0)
@@ -53,7 +54,8 @@ function getAjv(strict) {
5354
keywords: ["meta:enum"],
5455
schemas: {
5556
'http://cyclonedx.org/schema/spdx.schema.json': spdxSchema,
56-
'http://cyclonedx.org/schema/jsf-0.82.schema.json': jsfSchema
57+
'http://cyclonedx.org/schema/jsf-0.82.schema.json': jsfSchema,
58+
'http://cyclonedx.org/schema/cryptography-defs.schema.json': cryptoDefsSchema
5759
}
5860
});
5961
addFormats(ajv)

0 commit comments

Comments
 (0)