Skip to content

Commit 71f8dfa

Browse files
committed
Add log-process-errors
1 parent b0810e1 commit 71f8dfa

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
"get-node": "^15.0.0",
7272
"is-in-ci": "^1.0.0",
7373
"is-running": "^2.1.0",
74+
"log-process-errors": "^12.0.1",
7475
"path-exists": "^5.0.0",
7576
"path-key": "^4.0.0",
7677
"tempfile": "^5.0.0",

test/helpers/fixtures-directory.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
import path from 'node:path';
22
import process from 'node:process';
33
import {fileURLToPath} from 'node:url';
4+
import logProcessErrors from 'log-process-errors';
45
import pathKey from 'path-key';
56

7+
// Make tests fail if any warning (such as a deprecation warning) is emitted
8+
logProcessErrors({
9+
onError(error, event) {
10+
if (event === 'warning') {
11+
throw error;
12+
}
13+
},
14+
});
15+
616
export const PATH_KEY = pathKey();
717
export const FIXTURES_DIRECTORY_URL = new URL('../fixtures/', import.meta.url);
818
// @todo: use import.meta.dirname after dropping support for Node <20.11.0

0 commit comments

Comments
 (0)