Skip to content

Commit fc5e570

Browse files
committed
devcontainer outdated test
1 parent 621c930 commit fc5e570

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/test/container-features/lockfile.test.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,4 +258,24 @@ describe('Lockfile', function () {
258258
await cleanup();
259259
}
260260
});
261+
262+
it('outdated command should work with default workspace folder', async () => {
263+
const workspaceFolder = path.join(__dirname, 'configs/lockfile-outdated-command');
264+
const absoluteTmpPath = path.resolve(__dirname, 'tmp');
265+
const absoluteCli = `npx --prefix ${absoluteTmpPath} devcontainer`;
266+
267+
const originalCwd = process.cwd();
268+
try {
269+
process.chdir(workspaceFolder);
270+
const res = await shellExec(`${absoluteCli} outdated --output-format json`);
271+
const response = JSON.parse(res.stdout);
272+
273+
// Should have same structure as the test with explicit workspace-folder
274+
assert.ok(response.features);
275+
assert.ok(response.features['ghcr.io/devcontainers/features/git:1.0']);
276+
assert.strictEqual(response.features['ghcr.io/devcontainers/features/git:1.0'].current, '1.0.4');
277+
} finally {
278+
process.chdir(originalCwd);
279+
}
280+
});
261281
});

0 commit comments

Comments
 (0)