@@ -12,7 +12,7 @@ const pkg = require('../../package.json');
1212describe ( 'Dev Containers CLI' , function ( ) {
1313 this . timeout ( '120s' ) ;
1414
15- const tmp = path . relative ( process . cwd ( ) , path . join ( __dirname , 'tmp' ) ) ;
15+ const tmp = path . join ( __dirname , 'tmp' ) ;
1616 const cli = `npx --prefix ${ tmp } devcontainer` ;
1717
1818 before ( 'Install' , async ( ) => {
@@ -79,7 +79,7 @@ describe('Dev Containers CLI', function () {
7979 } ) ;
8080 } ) ;
8181
82- describe ( 'Command read-configuration' , ( ) => {
82+ describe . only ( 'Command read-configuration' , ( ) => {
8383 it ( 'should succeed and return postAttachCommand from config' , async ( ) => {
8484
8585 const containerId = ( await shellExec ( `docker run -d alpine:3.17 sleep inf` ) ) . stdout . trim ( ) ;
@@ -103,6 +103,18 @@ describe('Dev Containers CLI', function () {
103103
104104 await shellExec ( `docker rm -f ${ containerId } ` ) ;
105105 } ) ;
106+
107+ it ( 'should succeed without a workspace folder' , async ( ) => {
108+
109+ await shellExec ( `docker build -t devcontainer-set-up-test ${ __dirname } /configs/set-up-with-metadata` ) ;
110+ const containerId = ( await shellExec ( `docker run -d devcontainer-set-up-test sleep inf` ) ) . stdout . trim ( ) ;
111+
112+ const res = await shellExec ( `${ cli } read-configuration --include-merged-configuration` , { cwd : `${ __dirname } /configs/set-up-with-metadata` } ) ;
113+ const response = JSON . parse ( res . stdout ) ;
114+ assert . strictEqual ( response . mergedConfiguration . postCreateCommands . length , 1 ) ;
115+
116+ await shellExec ( `docker rm -f ${ containerId } ` ) ;
117+ } ) ;
106118 } ) ;
107119
108120 describe ( 'Command exec' , ( ) => {
0 commit comments