Bump jest and @types/jest (#182)
* Bump jest and @types/jest Bumps [jest](https://github.com/jestjs/jest/tree/HEAD/packages/jest) and [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest). These dependencies needed to be updated together. Updates `jest` from 29.7.0 to 30.0.0 - [Release notes](https://github.com/jestjs/jest/releases) - [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/jestjs/jest/commits/v30.0.0/packages/jest) Updates `@types/jest` from 29.5.14 to 30.0.0 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: jest dependency-version: 30.0.0 dependency-type: direct:development update-type: version-update:semver-major - dependency-name: "@types/jest" dependency-version: 30.0.0 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * ts isolated modules Signed-off-by: Brian DeHamer <bdehamer@github.com> * test coverage Signed-off-by: Brian DeHamer <bdehamer@github.com> * rebuild dist Signed-off-by: Brian DeHamer <bdehamer@github.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Brian DeHamer <bdehamer@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Brian DeHamer <bdehamer@github.com>
This commit is contained in:
@@ -108,6 +108,13 @@ describe('generateSBOMPredicate', () => {
|
||||
expect(result.params).toEqual(sbom.object)
|
||||
})
|
||||
|
||||
it('throws an error for missing SPDX version', () => {
|
||||
const sbom = { type: 'spdx' } as SBOM
|
||||
expect(() => generateSBOMPredicate(sbom)).toThrow(
|
||||
'Cannot find spdxVersion in the SBOM'
|
||||
)
|
||||
})
|
||||
|
||||
it('generates CycloneDX predicate correctly', () => {
|
||||
const sbom = { type: 'cyclonedx', object: {} } as SBOM
|
||||
const result = generateSBOMPredicate(sbom)
|
||||
@@ -116,10 +123,8 @@ describe('generateSBOMPredicate', () => {
|
||||
})
|
||||
|
||||
it('throws error for unsupported SBOM formats', () => {
|
||||
const sbom = { type: 'spdx', object: {} }
|
||||
const sbom = { type: 'foo', object: {} }
|
||||
// @ts-expect-error test error case
|
||||
expect(() => generateSBOMPredicate(sbom)).toThrow(
|
||||
'Cannot find spdxVersion in the SBOM'
|
||||
)
|
||||
expect(() => generateSBOMPredicate(sbom)).toThrow('Unsupported SBOM format')
|
||||
})
|
||||
})
|
||||
|
||||
+7
-6
@@ -25800,13 +25800,14 @@ const storePredicate = (predicate) => {
|
||||
};
|
||||
exports.storePredicate = storePredicate;
|
||||
const generateSBOMPredicate = (sbom) => {
|
||||
if (sbom.type === 'spdx') {
|
||||
return generateSPDXIntoto(sbom.object);
|
||||
switch (sbom.type) {
|
||||
case 'spdx':
|
||||
return generateSPDXIntoto(sbom.object);
|
||||
case 'cyclonedx':
|
||||
return generateCycloneDXIntoto(sbom.object);
|
||||
default:
|
||||
throw new Error('Unsupported SBOM format');
|
||||
}
|
||||
if (sbom.type === 'cyclonedx') {
|
||||
return generateCycloneDXIntoto(sbom.object);
|
||||
}
|
||||
throw new Error('Unsupported SBOM format');
|
||||
};
|
||||
exports.generateSBOMPredicate = generateSBOMPredicate;
|
||||
// ref: https://github.com/in-toto/attestation/blob/main/spec/predicates/spdx.md
|
||||
|
||||
Generated
+1533
-1129
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -75,13 +75,13 @@
|
||||
"devDependencies": {
|
||||
"@actions/attest": "^1.6.0",
|
||||
"@eslint/js": "^9.29.0",
|
||||
"@types/jest": "^29.5.14",
|
||||
"@types/jest": "^30.0.0",
|
||||
"@types/node": "^24.0.3",
|
||||
"@vercel/ncc": "^0.38.3",
|
||||
"eslint": "^9.29.0",
|
||||
"eslint-plugin-import": "^2.31.0",
|
||||
"eslint-plugin-jest": "^28.14.0",
|
||||
"jest": "^29.7.0",
|
||||
"jest": "^30.0.0",
|
||||
"markdownlint-cli": "^0.45.0",
|
||||
"prettier": "^3.5.3",
|
||||
"ts-jest": "^29.4.0",
|
||||
|
||||
+7
-6
@@ -66,13 +66,14 @@ export const storePredicate = (predicate: Predicate): string => {
|
||||
}
|
||||
|
||||
export const generateSBOMPredicate = (sbom: SBOM): Predicate => {
|
||||
if (sbom.type === 'spdx') {
|
||||
return generateSPDXIntoto(sbom.object)
|
||||
switch (sbom.type) {
|
||||
case 'spdx':
|
||||
return generateSPDXIntoto(sbom.object)
|
||||
case 'cyclonedx':
|
||||
return generateCycloneDXIntoto(sbom.object)
|
||||
default:
|
||||
throw new Error('Unsupported SBOM format')
|
||||
}
|
||||
if (sbom.type === 'cyclonedx') {
|
||||
return generateCycloneDXIntoto(sbom.object)
|
||||
}
|
||||
throw new Error('Unsupported SBOM format')
|
||||
}
|
||||
|
||||
// ref: https://github.com/in-toto/attestation/blob/main/spec/predicates/spdx.md
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
"module": "NodeNext",
|
||||
"rootDir": "./src",
|
||||
"moduleResolution": "NodeNext",
|
||||
"isolatedModules": true,
|
||||
"baseUrl": "./",
|
||||
"sourceMap": true,
|
||||
"outDir": "./dist",
|
||||
|
||||
Reference in New Issue
Block a user