Skip to content

Commit 153bed8

Browse files
committed
fix test:notelemetry script to work with latest execa
1 parent 0e6a5a1 commit 153bed8

File tree

3 files changed

+31
-34
lines changed

3 files changed

+31
-34
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"release": "release-it",
2828
"test": "codemod-cli test --coverage",
2929
"test:integration": "node ./test/run-test.mjs",
30-
"test:notelemetry": " node ./test/run-test-without-telemetry.js"
30+
"test:notelemetry": " node ./test/run-test-without-telemetry.mjs"
3131
},
3232
"jest": {
3333
"collectCoverageFrom": [

test/run-test-without-telemetry.js

Lines changed: 0 additions & 33 deletions
This file was deleted.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/* eslint-disable no-console */
2+
import { execa } from 'execa';
3+
import path from 'path';
4+
5+
// resolved from the root of the project
6+
const inputDir = path.resolve('./test/fixtures/without-telemetry/input');
7+
const binPath = path.resolve('./bin/cli.js');
8+
const execOpts = { cwd: inputDir, stderr: 'inherit' };
9+
10+
console.log('running codemod');
11+
12+
const codemod = execa(binPath, ['app'], execOpts);
13+
codemod.stdout.pipe(process.stdout);
14+
await codemod;
15+
16+
console.log('codemod complete');
17+
18+
console.log('comparing results');
19+
20+
try {
21+
await execa('diff', ['-rq', './app', '../output/app'], execOpts);
22+
} catch (e) {
23+
console.error('codemod did not run successfully');
24+
console.log(e);
25+
26+
process.exit(1);
27+
}
28+
29+
console.log('codemod ran successfully! 🎉');
30+
process.exit(0);

0 commit comments

Comments
 (0)