@@ -14,7 +14,7 @@ const pkg = require('../../../package.json');
1414describe ( 'Lockfile' , function ( ) {
1515 this . timeout ( '240s' ) ;
1616
17- const tmp = path . relative ( process . cwd ( ) , path . join ( __dirname , 'tmp' ) ) ;
17+ const tmp = path . join ( __dirname , 'tmp' ) ;
1818 const cli = `npx --prefix ${ tmp } devcontainer` ;
1919
2020 before ( 'Install' , async ( ) => {
@@ -125,7 +125,7 @@ describe('Lockfile', function () {
125125 assert . strictEqual ( foo . latestMajor , '2' ) ;
126126 } ) ;
127127
128- it ( 'outdated command with text output' , async ( ) => {
128+ it . only ( 'outdated command with text output' , async ( ) => {
129129 const workspaceFolder = path . join ( __dirname , 'configs/lockfile-outdated-command' ) ;
130130
131131 const res = await shellExec ( `${ cli } outdated --workspace-folder ${ workspaceFolder } --output-format text` ) ;
@@ -151,6 +151,20 @@ describe('Lockfile', function () {
151151 assert . ok ( ! response . includes ( 'terraform' ) ) ;
152152 assert . ok ( ! response . includes ( 'myfeatures' ) ) ;
153153 } ) ;
154+
155+ it . only ( 'outdated command without workspace' , async ( ) => {
156+ const workspaceFolder = path . join ( __dirname , 'configs/lockfile-outdated-command' ) ;
157+
158+ const res = await shellExec ( `${ cli } outdated --output-format text` , { cwd : workspaceFolder } ) ;
159+ const response = res . stdout ;
160+ // Count number of lines of output
161+ assert . strictEqual ( response . split ( '\n' ) . length , 7 ) ; // 5 valid Features + header + empty line
162+
163+ // Check that the header is present
164+ assert . ok ( response . includes ( 'Current' ) , 'Current column is missing' ) ;
165+ assert . ok ( response . includes ( 'Wanted' ) , 'Wanted column is missing' ) ;
166+ assert . ok ( response . includes ( 'Latest' ) , 'Latest column is missing' ) ;
167+ } ) ;
154168
155169 it ( 'upgrade command' , async ( ) => {
156170 const workspaceFolder = path . join ( __dirname , 'configs/lockfile-upgrade-command' ) ;
0 commit comments