File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -212,6 +212,16 @@ suite('create-package-json', () => {
212212 assert . strictEqual ( pkg . private , true ) ;
213213 } ) ;
214214
215+ // Remove null/undefined keys
216+ test ( 'remove null/undefined keys' , async ( ) => {
217+ await fix . setup ( ) ;
218+ const pkg = await createPackageJson ( {
219+ private : null
220+ } ) ;
221+
222+ assert . strictEqual ( pkg . private , undefined ) ;
223+ } ) ;
224+
215225 test ( 'scaffold scripts' , async ( ) => {
216226 await fix . setup ( ) ;
217227 const pkg = await createPackageJson ( ) ;
@@ -276,10 +286,10 @@ suite('create-package-json', () => {
276286 assert . deepStrictEqual ( pkg . scripts , npmInitPkg . scripts ) ;
277287 assert . deepStrictEqual ( pkg . keywords , npmInitPkg . keywords ) ;
278288 assert . strictEqual ( pkg . license , npmInitPkg . license ) ;
289+ assert . strictEqual ( pkg . type , npmInitPkg . type ) ;
279290
280291 // Should be different
281292 assert . notStrictEqual ( pkg . author , npmInitPkg . author , JSON . stringify ( [ pkg . author , npmInitPkg . author ] ) ) ;
282- assert . notStrictEqual ( pkg . type , npmInitPkg . type , JSON . stringify ( [ pkg . type , npmInitPkg . type ] ) ) ;
283293 } ) ;
284294 } ) ;
285295} ) ;
You can’t perform that action at this time.
0 commit comments