File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -523,6 +523,9 @@ export class Manifest {
523523 if ( typeof data . publishConfig . registry === `string` )
524524 this . publishConfig . registry = data . publishConfig . registry ;
525525
526+ if ( typeof data . publishConfig . provenance === `boolean` )
527+ this . publishConfig . provenance = data . publishConfig . provenance ;
528+
526529 if ( typeof data . publishConfig . bin === `string` ) {
527530 if ( this . name !== null ) {
528531 this . publishConfig . bin = new Map ( [ [ this . name . name , normalizeSlashes ( data . publishConfig . bin ) ] ] ) ;
Original file line number Diff line number Diff line change @@ -55,4 +55,21 @@ describe(`Manifest`, () => {
5555 expect ( manifest . exportTo ( { } ) . bin ) . toEqual ( { bin2 : `./bin2.js` } ) ;
5656 } ) ;
5757 } ) ;
58+
59+ describe ( `publishConfig` , ( ) => {
60+ it ( `should parse provenance field when set to true` , ( ) => {
61+ const manifest = Manifest . fromText ( `{ "publishConfig": { "provenance": true } }` ) ;
62+ expect ( manifest . publishConfig ?. provenance ) . toBe ( true ) ;
63+ } ) ;
64+
65+ it ( `should parse provenance field when set to false` , ( ) => {
66+ const manifest = Manifest . fromText ( `{ "publishConfig": { "provenance": false } }` ) ;
67+ expect ( manifest . publishConfig ?. provenance ) . toBe ( false ) ;
68+ } ) ;
69+
70+ it ( `should ignore non-boolean provenance values` , ( ) => {
71+ const manifest = Manifest . fromText ( `{ "publishConfig": { "provenance": "true" } }` ) ;
72+ expect ( manifest . publishConfig ?. provenance ) . toBeUndefined ( ) ;
73+ } ) ;
74+ } ) ;
5875} ) ;
You can’t perform that action at this time.
0 commit comments