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)
|
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', () => {
|
it('generates CycloneDX predicate correctly', () => {
|
||||||
const sbom = { type: 'cyclonedx', object: {} } as SBOM
|
const sbom = { type: 'cyclonedx', object: {} } as SBOM
|
||||||
const result = generateSBOMPredicate(sbom)
|
const result = generateSBOMPredicate(sbom)
|
||||||
@@ -116,10 +123,8 @@ describe('generateSBOMPredicate', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('throws error for unsupported SBOM formats', () => {
|
it('throws error for unsupported SBOM formats', () => {
|
||||||
const sbom = { type: 'spdx', object: {} }
|
const sbom = { type: 'foo', object: {} }
|
||||||
// @ts-expect-error test error case
|
// @ts-expect-error test error case
|
||||||
expect(() => generateSBOMPredicate(sbom)).toThrow(
|
expect(() => generateSBOMPredicate(sbom)).toThrow('Unsupported SBOM format')
|
||||||
'Cannot find spdxVersion in the SBOM'
|
|
||||||
)
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
+7
-6
@@ -25800,13 +25800,14 @@ const storePredicate = (predicate) => {
|
|||||||
};
|
};
|
||||||
exports.storePredicate = storePredicate;
|
exports.storePredicate = storePredicate;
|
||||||
const generateSBOMPredicate = (sbom) => {
|
const generateSBOMPredicate = (sbom) => {
|
||||||
if (sbom.type === 'spdx') {
|
switch (sbom.type) {
|
||||||
return generateSPDXIntoto(sbom.object);
|
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;
|
exports.generateSBOMPredicate = generateSBOMPredicate;
|
||||||
// ref: https://github.com/in-toto/attestation/blob/main/spec/predicates/spdx.md
|
// 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": {
|
"devDependencies": {
|
||||||
"@actions/attest": "^1.6.0",
|
"@actions/attest": "^1.6.0",
|
||||||
"@eslint/js": "^9.29.0",
|
"@eslint/js": "^9.29.0",
|
||||||
"@types/jest": "^29.5.14",
|
"@types/jest": "^30.0.0",
|
||||||
"@types/node": "^24.0.3",
|
"@types/node": "^24.0.3",
|
||||||
"@vercel/ncc": "^0.38.3",
|
"@vercel/ncc": "^0.38.3",
|
||||||
"eslint": "^9.29.0",
|
"eslint": "^9.29.0",
|
||||||
"eslint-plugin-import": "^2.31.0",
|
"eslint-plugin-import": "^2.31.0",
|
||||||
"eslint-plugin-jest": "^28.14.0",
|
"eslint-plugin-jest": "^28.14.0",
|
||||||
"jest": "^29.7.0",
|
"jest": "^30.0.0",
|
||||||
"markdownlint-cli": "^0.45.0",
|
"markdownlint-cli": "^0.45.0",
|
||||||
"prettier": "^3.5.3",
|
"prettier": "^3.5.3",
|
||||||
"ts-jest": "^29.4.0",
|
"ts-jest": "^29.4.0",
|
||||||
|
|||||||
+7
-6
@@ -66,13 +66,14 @@ export const storePredicate = (predicate: Predicate): string => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const generateSBOMPredicate = (sbom: SBOM): Predicate => {
|
export const generateSBOMPredicate = (sbom: SBOM): Predicate => {
|
||||||
if (sbom.type === 'spdx') {
|
switch (sbom.type) {
|
||||||
return generateSPDXIntoto(sbom.object)
|
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
|
// ref: https://github.com/in-toto/attestation/blob/main/spec/predicates/spdx.md
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
"module": "NodeNext",
|
"module": "NodeNext",
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
"moduleResolution": "NodeNext",
|
"moduleResolution": "NodeNext",
|
||||||
|
"isolatedModules": true,
|
||||||
"baseUrl": "./",
|
"baseUrl": "./",
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"outDir": "./dist",
|
"outDir": "./dist",
|
||||||
|
|||||||
Reference in New Issue
Block a user