diff --git a/tests/mocha-reporter.js b/tests/mocha-reporter.js index 1b8c7854a..a251b9eb4 100644 --- a/tests/mocha-reporter.js +++ b/tests/mocha-reporter.js @@ -75,7 +75,9 @@ module.exports = class ServerlessSpec extends Spec { try { removeSync(tmpDirCommonPath); } catch (error) { - if (error.code !== 'ENOENT') throw error; + if (error.code !== 'ENOENT' || (error.code !== 'EPERM' || process.platform !== 'win32')) { + throw error; + } } if (process.version[1] < 8) return; // Async leaks detector is not reliable in Node.js v6