@@ -49,6 +49,21 @@ test.serial('Updade package.json and npm-shrinkwrap.json', async t => {
4949t . deepEqual ( t . context . log . args [ 1 ] , [ 'Wrote version %s to %s' , '1.0.0' , 'npm-shrinkwrap.json' ] ) ;
5050} ) ;
5151
52+ test . serial ( 'Updade package.json and package-lock.json' , async t => {
53+ // Create package.json in repository root
54+ await outputJson ( './package.json' , { version :'0.0.0-dev' } ) ;
55+ // Create a npm-shrinkwrap.json file
56+ await execa ( 'npm' , [ 'install' ] ) ;
57+
58+ await updatePackageVersion ( '1.0.0' , '.' , t . context . logger ) ;
59+
60+ // Verify package.json and npm-shrinkwrap.json have been updated
61+ t . is ( ( await readJson ( './package.json' ) ) . version , '1.0.0' ) ;
62+ t . is ( ( await readJson ( './package-lock.json' ) ) . version , '1.0.0' ) ;
63+ // Verify the logger has been called with the version updated
64+ t . deepEqual ( t . context . log . args [ 0 ] , [ 'Wrote version %s to %s' , '1.0.0' , 'package.json' ] ) ;
65+ t . deepEqual ( t . context . log . args [ 1 ] , [ 'Wrote version %s to %s' , '1.0.0' , 'package-lock.json' ] ) ;
66+ } ) ;
5267
5368test . serial ( 'Updade package.json and npm-shrinkwrap.json in a sub-directory' , async t => {
5469// Create package.json in repository root