File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
src/test/container-features Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -278,4 +278,24 @@ describe('Lockfile', function () {
278278 process . chdir ( originalCwd ) ;
279279 }
280280 } ) ;
281+
282+ it ( 'upgrade command should work with default workspace folder' , async ( ) => {
283+ const workspaceFolder = path . join ( __dirname , 'configs/lockfile-upgrade-command' ) ;
284+ const absoluteTmpPath = path . resolve ( __dirname , 'tmp' ) ;
285+ const absoluteCli = `npx --prefix ${ absoluteTmpPath } devcontainer` ;
286+
287+ const lockfilePath = path . join ( workspaceFolder , '.devcontainer-lock.json' ) ;
288+ await cpLocal ( path . join ( workspaceFolder , 'outdated.devcontainer-lock.json' ) , lockfilePath ) ;
289+
290+ const originalCwd = process . cwd ( ) ;
291+ try {
292+ process . chdir ( workspaceFolder ) ;
293+ await shellExec ( `${ absoluteCli } upgrade` ) ;
294+ const actual = await readLocalFile ( lockfilePath ) ;
295+ const expected = await readLocalFile ( path . join ( workspaceFolder , 'upgraded.devcontainer-lock.json' ) ) ;
296+ assert . equal ( actual . toString ( ) , expected . toString ( ) ) ;
297+ } finally {
298+ process . chdir ( originalCwd ) ;
299+ }
300+ } ) ;
281301} ) ;
You can’t perform that action at this time.
0 commit comments