@@ -6,6 +6,9 @@ const util = require('util')
66const zlib = require ( 'zlib' )
77const gzip = util . promisify ( zlib . gzip )
88const path = require ( 'path' )
9+ const fs = require ( 'fs' )
10+
11+ t . cleanSnapshot = str => str . replace ( / [ 0 - 9 ] + m s / g, 'xxxms' )
912
1013const tree = {
1114 'package.json' : JSON . stringify ( {
@@ -114,7 +117,6 @@ t.test('audit fix', async t => {
114117 tap : t ,
115118 registry : npm . config . get ( 'registry' ) ,
116119 } )
117- // with fix
118120 const manifest = registry . manifest ( {
119121 name : 'test-dep-a' ,
120122 packuments : [ { version : '1.0.0' } , { version : '1.0.1' } ] ,
@@ -139,6 +141,12 @@ t.test('audit fix', async t => {
139141 } )
140142 await npm . exec ( 'audit' , [ 'fix' ] )
141143 t . matchSnapshot ( joinedOutput ( ) )
144+ const pkg = fs . readFileSync ( path . join ( npm . prefix , 'package-lock.json' ) , 'utf8' )
145+ t . matchSnapshot ( pkg , 'lockfile has test-dep-a@1.0.1' )
146+ t . ok (
147+ fs . existsSync ( path . join ( npm . prefix , 'node_modules' , 'test-dep-a' , 'fixed.txt' ) ) ,
148+ 'has test-dep-a@1.0.1 on disk'
149+ )
142150} )
143151
144152t . test ( 'completion' , async t => {
0 commit comments