Comparing version 1.0.2 to 1.1.0
@@ -39,5 +39,2 @@ "use strict"; | ||
}; | ||
const clearCache = () => { | ||
delete cache[key]; | ||
}; | ||
if (typeof beforeAll === 'function') { | ||
@@ -55,8 +52,13 @@ beforeAll(push); | ||
} | ||
if (typeof afterEach === 'function') { | ||
afterEach(clearCache); | ||
} | ||
}; | ||
if (typeof afterEach === 'function') { | ||
afterEach(() => { | ||
const cache = given.__cache__; | ||
Object.keys(cache).forEach((key) => { | ||
delete cache[key]; | ||
}); | ||
}); | ||
} | ||
return given; | ||
}; | ||
exports.default = getGivenFunc; |
{ | ||
"name": "givens", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"description": "Easy test setup without side effects", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -38,3 +38,3 @@ <p align="center"> | ||
{ | ||
setupFiles: [ | ||
setupFilesAfterEnv: [ // this CANNOT be setupFiles | ||
'givens/setup.js', | ||
@@ -41,0 +41,0 @@ ], |
12695
211