Skip to content

Commit

Permalink
chore: simplify process.exit mock
Browse files Browse the repository at this point in the history
  • Loading branch information
PaperStrike committed Nov 8, 2021
1 parent f52bed0 commit ae8c15d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
6 changes: 1 addition & 5 deletions test/bin/diff.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,9 @@ describe('diff', () => {
consoleLog(...args);
}
});
let exitResolve;
exitStatus = new Promise(resolve => {
exitResolve = resolve;
process.exit = resolve;
});
process.exit = (status) => {
exitResolve(status);
};
});

afterEach(() => {
Expand Down
6 changes: 1 addition & 5 deletions test/bin/find.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,9 @@ describe('bin', () => {
}
consoleLog(...args);
};
let exitResolve;
exitStatus = new Promise(resolve => {
exitResolve = resolve;
process.exit = resolve;
});
process.exit = status => {
exitResolve(status);
};
process.argv = process.argv.slice(0, 2);
});

Expand Down

0 comments on commit ae8c15d

Please sign in to comment.