Skip to content

Commit a2f2a16

Browse files
committed
feat: uses echo in tests for cross platform
1 parent 7882f42 commit a2f2a16

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

app-config-exec/src/index.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const defaultOptions = {
99
describe('execParsingExtension', () => {
1010
it('reads from command as root level string', async () => {
1111
process.env.APP_CONFIG = JSON.stringify({
12-
$exec: 'printf test123',
12+
$exec: 'echo test123',
1313
});
1414

1515
const { fullConfig } = await loadUnvalidatedConfig(defaultOptions);
@@ -19,7 +19,7 @@ describe('execParsingExtension', () => {
1919

2020
it('reads from command within nested object options', async () => {
2121
process.env.APP_CONFIG = JSON.stringify({
22-
$exec: { command: 'printf test123' },
22+
$exec: { command: 'echo test123' },
2323
});
2424

2525
const { fullConfig } = await loadUnvalidatedConfig(defaultOptions);
@@ -29,7 +29,7 @@ describe('execParsingExtension', () => {
2929

3030
it('reads JSON as string by default', async () => {
3131
process.env.APP_CONFIG = JSON.stringify({
32-
$exec: { command: `printf '{"test": true}'` },
32+
$exec: { command: `echo '{"test": true}'` },
3333
});
3434

3535
const { fullConfig } = await loadUnvalidatedConfig(defaultOptions);
@@ -39,7 +39,7 @@ describe('execParsingExtension', () => {
3939

4040
it('parses JSON if parseOutput true', async () => {
4141
process.env.APP_CONFIG = JSON.stringify({
42-
$exec: { command: `printf '{"test": true}'`, parseOutput: true },
42+
$exec: { command: `echo '{"test": true}'`, parseOutput: true },
4343
});
4444

4545
const { fullConfig } = await loadUnvalidatedConfig(defaultOptions);
@@ -49,7 +49,7 @@ describe('execParsingExtension', () => {
4949

5050
it('trims whitespace by default', async () => {
5151
process.env.APP_CONFIG = JSON.stringify({
52-
$exec: { command: `printf ' test123\n'` },
52+
$exec: { command: `echo ' test123\n'` },
5353
});
5454

5555
const { fullConfig } = await loadUnvalidatedConfig(defaultOptions);
@@ -59,7 +59,7 @@ describe('execParsingExtension', () => {
5959

6060
it('reads raw output if trimWhitespace false', async () => {
6161
process.env.APP_CONFIG = JSON.stringify({
62-
$exec: { command: `printf ' test123\n'`, trimWhitespace: false },
62+
$exec: { command: `echo ' test123'`, trimWhitespace: false },
6363
});
6464

6565
const { fullConfig } = await loadUnvalidatedConfig(defaultOptions);

0 commit comments

Comments
 (0)