electron/spec/ts-smoke/runner.js
Milan Burda d78f37ec8f
refactor: use node scheme imports in spec (#38487)
Co-authored-by: Milan Burda <miburda@microsoft.com>
2023-06-15 10:42:27 -04:00

18 lines
602 B
JavaScript

const path = require('node:path');
const childProcess = require('node:child_process');
const typeCheck = () => {
const tscExec = path.resolve(require.resolve('typescript'), '../../bin/tsc');
const tscChild = childProcess.spawn(process.execPath, [tscExec, '--project', './ts-smoke/tsconfig.json'], {
cwd: path.resolve(__dirname, '../')
});
tscChild.stdout.on('data', d => console.log(d.toString()));
tscChild.stderr.on('data', d => console.error(d.toString()));
tscChild.on('exit', (tscStatus) => {
if (tscStatus !== 0) {
process.exit(tscStatus);
}
});
};
typeCheck();