diff --git a/package.json b/package.json index 1fc21e4..982bc2a 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,6 @@ }, "mocha": { "recursive": true, - "require": "test/hooks.js" + "require": "test/root-hook" } } diff --git a/test/root-hook.js b/test/root-hook.js new file mode 100644 index 0000000..2ededd2 --- /dev/null +++ b/test/root-hook.js @@ -0,0 +1,6 @@ +const fs = require("fs-extra"); + +exports.mochaHooks = { + beforeAll: () => (global.config = { configDir: "config" }), + afterAll: () => fs.remove("config"), +};