Skip to content

Commit 0a4fca7

Browse files
committed
test: try execa again
1 parent 6a3219e commit 0a4fca7

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
.DS_Store
33
node_modules
44
dist
5+
test/.cache

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@
5050
"tsdx": "^0.14.1",
5151
"tslib": "^2.3.1",
5252
"tsup": "^5.11.11",
53-
"typescript": "^4.5.5"
53+
"typescript": "^4.5.5",
54+
"execa": "^5.1.1"
5455
},
5556
"dependencies": {
5657
"bundle-require": "^3.0.2",

test/cli.test.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { execSync } from 'child_process';
1+
import execa from 'execa';
22
import glob from 'glob';
33
import path from 'path';
44
import fs from 'fs-extra';
@@ -16,7 +16,6 @@ const run = (recipe: string) => {
1616
'input'
1717
);
1818
const inputDest = path.resolve(cache, recipe);
19-
console.log({ originalInput, inputDest });
2019
fs.copySync(originalInput, inputDest);
2120

2221
// Run the command
@@ -30,9 +29,8 @@ const run = (recipe: string) => {
3029
const inputGlob = path.join(inputDest, '**', '*.css');
3130
const command = `${bin} -t ${transform} '${inputGlob}'`;
3231

33-
console.log({ transform, inputGlob, command });
3432
try {
35-
execSync(command);
33+
execa.sync(bin, ['-t', transform, inputGlob]);
3634
} catch (err) {
3735
console.error(`Error executing command: ${command}`);
3836
console.error(err);
@@ -59,7 +57,7 @@ const run = (recipe: string) => {
5957
};
6058

6159
const recipes = fs.readdirSync(path.resolve(__dirname, '..', 'recipes'));
62-
console.log({ recipes });
60+
6361
describe('cli', () => {
6462
beforeAll(() => {
6563
fs.removeSync(cache);

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3094,7 +3094,7 @@ execa@^4.0.3:
30943094
signal-exit "^3.0.2"
30953095
strip-final-newline "^2.0.0"
30963096

3097-
execa@^5.0.0:
3097+
execa@^5.0.0, execa@^5.1.1:
30983098
version "5.1.1"
30993099
resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd"
31003100
integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==

0 commit comments

Comments
 (0)