There was an error while loading. Please reload this page.
1 parent c5d7be2 commit 2b799a6Copy full SHA for 2b799a6
1 file changed
test/import.js
@@ -0,0 +1,16 @@
1
+const assert = require("assert")
2
+
3
+describe("Testing module import", () => {
4
+ it("doesn't install an uncaughtException handler when imported", () => {
5
+ const modulePath = require.resolve("../index.js")
6
+ const listenersBefore = process.listenerCount("uncaughtException")
7
8
+ delete require.cache[modulePath]
9
+ require(modulePath)
10
11
+ assert.strictEqual(
12
+ process.listenerCount("uncaughtException"),
13
+ listenersBefore
14
+ )
15
+ })
16
+})
0 commit comments