File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
src/project-type/publishable/provenance Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import {mergeIntoExistingPackageJson} from '@form8ion/javascript-core';
33import enhanceSlsa from './slsa.js' ;
44
55export default async function ( { projectRoot, packageDetails} ) {
6- const { publishConfig : { access} } = packageDetails ;
6+ const { publishConfig : { access} = { } } = packageDetails ;
77
88 if ( 'public' === access ) {
99 await mergeIntoExistingPackageJson ( { projectRoot, config : { publishConfig : { provenance : true } } } ) ;
Original file line number Diff line number Diff line change @@ -36,4 +36,12 @@ describe('provenance lifter', () => {
3636 expect ( enhanceSlsa ) . not . toHaveBeenCalled ( ) ;
3737 expect ( mergeIntoExistingPackageJson ) . not . toHaveBeenCalled ( ) ;
3838 } ) ;
39+
40+ it ( 'should not configure provenance for a package without `publishConfig`' , async ( ) => {
41+ const packageDetails = any . simpleObject ( ) ;
42+
43+ expect ( await lift ( { packageDetails, projectRoot} ) ) . toEqual ( { } ) ;
44+ expect ( enhanceSlsa ) . not . toHaveBeenCalled ( ) ;
45+ expect ( mergeIntoExistingPackageJson ) . not . toHaveBeenCalled ( ) ;
46+ } ) ;
3947} ) ;
You can’t perform that action at this time.
0 commit comments