Skip to content

Commit 1f4192a

Browse files
committed
test: try some tweaks
1 parent 2edaebb commit 1f4192a

1 file changed

Lines changed: 17 additions & 6 deletions

File tree

test/cli.test.ts

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,23 @@ import glob from 'glob';
33
import path from 'path';
44
import fs from 'fs-extra';
55

6-
const bin = path.join(__dirname, '..', 'dist', 'cli.js');
7-
const cache = path.join(__dirname, '.cache');
6+
const bin = path.resolve(__dirname, '..', 'dist', 'cli.js');
7+
const cache = path.resolve(__dirname, '.cache');
88

99
const run = (recipe: string) => {
1010
// Setup the test files
11-
const originalInput = path.join(__dirname, '..', 'recipes', recipe, 'input');
11+
const originalInput = path.resolve(
12+
__dirname,
13+
'..',
14+
'recipes',
15+
recipe,
16+
'input'
17+
);
1218
const inputDest = path.resolve(cache, recipe);
1319
fs.copySync(originalInput, inputDest);
1420

1521
// Run the command
16-
const transform = path.join(
22+
const transform = path.resolve(
1723
__dirname,
1824
'..',
1925
'recipes',
@@ -22,10 +28,15 @@ const run = (recipe: string) => {
2228
);
2329
const inputGlob = path.join(inputDest, '**', '*.css');
2430
const command = `${bin} -t ${transform} '${inputGlob}'`;
25-
execSync(command);
31+
try {
32+
execSync(command);
33+
} catch (err) {
34+
console.error(`Error executing command: ${command}`);
35+
console.error(err);
36+
}
2637

2738
// Compare results
28-
const expectedOutput = path.join(
39+
const expectedOutput = path.resolve(
2940
__dirname,
3041
'..',
3142
'recipes',

0 commit comments

Comments
 (0)