Skip to content

Commit 2d7f1c3

Browse files
satazorAmericas
authored andcommitted
Remove DEBUG check to fallback to console.error
1 parent 0dd3e29 commit 2d7f1c3

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

src/index.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,6 @@ class ProcessManager {
6767
this.log.error(`Exiting with ${this.errors.length} error${this.errors.length > 1 ? 's' : ''}`);
6868
this.errors.forEach(err => this.log.error(err));
6969

70-
// Output console to error in case no `DEBUG` namespace has been set.
71-
// This mimicks the default node behaviour of not silencing errors.
72-
if (!process.env.DEBUG) {
73-
// eslint-disable-next-line no-console
74-
console.error(...this.errors);
75-
}
76-
7770
return process.exit(1);
7871
}
7972

test/index.test.js

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -151,26 +151,6 @@ describe('ProcessManager', () => {
151151
expect(process.exit).toHaveBeenCalled();
152152
expect(process.exit).toHaveBeenCalledWith(1);
153153
});
154-
155-
test('calls `console.error` if `DEBUG` is not set', () => {
156-
processManager.errors = [new Error()];
157-
158-
processManager.exit();
159-
160-
expect(console.error).toHaveBeenCalled();
161-
expect(console.error).toHaveBeenCalledWith(...processManager.errors);
162-
});
163-
164-
test('does not call `console.error` if `DEBUG` is set', () => {
165-
process.env.DEBUG = 'foo';
166-
processManager.errors = [new Error()];
167-
168-
processManager.exit();
169-
170-
expect(console.error).not.toHaveBeenCalled();
171-
172-
delete process.env.DEBUG;
173-
});
174154
});
175155

176156
describe('hook()', () => {

0 commit comments

Comments
 (0)