diff --git a/lib/poller.js b/lib/poller.js index 5aa4f1a..0721620 100644 --- a/lib/poller.js +++ b/lib/poller.js @@ -127,6 +127,8 @@ class Poller extends EventEmitter { poll () { this.interval = setInterval(() => this.pollForChanges(), this.pollingRateSeconds * 1000) + // Do not force the Node.js event loop to remain open if the application is shutting down + this.interval.unref() } stop () { diff --git a/package.json b/package.json index 1cd620e..f1059a2 100644 --- a/package.json +++ b/package.json @@ -4,10 +4,10 @@ "description": "", "main": "lib/index.js", "scripts": { - "coverage": "nyc mocha --exit 'lib/*.test.js'", + "coverage": "nyc mocha 'lib/*.test.js'", "lint": "standard --fix --env mocha", "release": "standard-version --tag-prefix=''", - "test": "mocha --exit --recursive lib" + "test": "mocha --recursive lib" }, "repository": { "type": "git",