Skip to content

Commit fcac0f1

Browse files
committed
Fix unit test for CDS extractor
1 parent 9dfbe3b commit fcac0f1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

extractors/cds/tools/test/src/cds/compiler/command.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ describe('cds compiler command', () => {
6262
if (fullCommand === '-c cds --version') {
6363
throw new Error('Command not found');
6464
}
65-
if (fullCommand === '-c npx -y --package @sap/cds-dk cds --version') {
65+
// The shell-quote library escapes the command, so it becomes quoted
66+
if (fullCommand === "-c 'npx -y --package @sap/cds-dk cds' --version") {
6667
return Buffer.from('6.1.3');
6768
}
6869
throw new Error('Unexpected command');
@@ -87,7 +88,7 @@ describe('cds compiler command', () => {
8788
});
8889
expect(childProcess.execFileSync).toHaveBeenCalledWith(
8990
'sh',
90-
['-c', 'npx -y --package @sap/cds-dk cds --version'],
91+
['-c', "'npx -y --package @sap/cds-dk cds' --version"],
9192
{
9293
encoding: 'utf8',
9394
stdio: 'pipe',

0 commit comments

Comments
 (0)