File tree 2 files changed +9
-1
lines changed
src/project-type/publishable/provenance
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';
3
3
import enhanceSlsa from './slsa.js' ;
4
4
5
5
export default async function ( { projectRoot, packageDetails} ) {
6
- const { publishConfig : { access} } = packageDetails ;
6
+ const { publishConfig : { access} = { } } = packageDetails ;
7
7
8
8
if ( 'public' === access ) {
9
9
await mergeIntoExistingPackageJson ( { projectRoot, config : { publishConfig : { provenance : true } } } ) ;
Original file line number Diff line number Diff line change @@ -36,4 +36,12 @@ describe('provenance lifter', () => {
36
36
expect ( enhanceSlsa ) . not . toHaveBeenCalled ( ) ;
37
37
expect ( mergeIntoExistingPackageJson ) . not . toHaveBeenCalled ( ) ;
38
38
} ) ;
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
+ } ) ;
39
47
} ) ;
You can’t perform that action at this time.
0 commit comments