Skip to content

Commit

Permalink
fix: remove async/await
Browse files Browse the repository at this point in the history
  • Loading branch information
azz committed Dec 19, 2017
1 parent 5680181 commit 44d702c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
},
"jest": {
"projects": [
"<rootDir>/jest.*.config.js"
"<rootDir>/jest.test.config.js",
"<rootDir>/jest.eslint.config.js"
]
},
"devDependencies": {
Expand Down
20 changes: 11 additions & 9 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,17 @@ module.exports = class TscTestRunner {
});
});

const onError = async (err, test) => {
await onFailure(test, err);
if (err.type === 'ProcessTerminatedError') {
console.error(
'A worker process has quit unexpectedly! ' +
'Most likely this is an initialization error.'
);
process.exit(1);
}
const onError = (err, test) => {
return onFailure(test, err).then(() => {
if (err.type === 'ProcessTerminatedError') {
// eslint-disable-next-line no-console
console.error(
'A worker process has quit unexpectedly! ' +
'Most likely this is an initialization error.'
);
process.exit(1);
}
});
};

const onInterrupt = new Promise((_, reject) => {
Expand Down
2 changes: 1 addition & 1 deletion src/runTsc.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const convertErrors = ({ start, end, errors, testPath }) => ({
),
});

const runTsc = ({ testPath, config }, workerCallback) => {
const runTsc = ({ testPath /*, config */ }, workerCallback) => {
try {
const start = +new Date();
const program = ts.createProgram([testPath], {
Expand Down

0 comments on commit 44d702c

Please sign in to comment.