diff --git a/test/custom-handlers.test.js b/test/custom-handlers.test.js index 4fa4fc94..8c2f95d3 100644 --- a/test/custom-handlers.test.js +++ b/test/custom-handlers.test.js @@ -1,6 +1,11 @@ const cwd = process.cwd() +const is_jest = !!global.test +if (is_jest) { // it's jest + global.before = (msg,fn) => global.beforeAll(fn||msg) + global.after = (msg,fn) => global.afterAll(fn||msg) +} before (()=> process.chdir(__dirname)) -after(()=> process.chdir(cwd)) +after (()=> process.chdir(cwd)) describe('Custom Handlers', () => { const { GET, POST, expect } = require('./capire').launch('bookshop')