We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6d4f814 commit ef7e727Copy full SHA for ef7e727
test/wtfnode.ts
@@ -1,7 +1,23 @@
1
+import * as util from "util"
2
import * as wtfnode from "wtfnode"
3
4
+// Jest seems to hijack console.log in a way that makes the output difficult to
5
+// read. So we'll write directly to process.stderr instead.
6
+const write = (...args: [any, ...any]) => {
7
+ if (args.length > 0) {
8
+ process.stderr.write(util.format(...args) + "\n")
9
+ }
10
+}
11
+wtfnode.setLogger("info", write)
12
+wtfnode.setLogger("warn", write)
13
+wtfnode.setLogger("error", write)
14
+
15
let active = false
16
17
+/**
18
+ * Start logging open handles periodically. This can be used to see what is
19
+ * hanging open if anything.
20
+ */
21
export function setup(): void {
22
if (active) {
23
return
0 commit comments