diff --git a/lib/classes/Error.test.js b/lib/classes/Error.test.js
index <HASH>..<HASH> 100644
--- a/lib/classes/Error.test.js
+++ b/lib/classes/Error.test.js
@@ -107,15 +107,21 @@ describe('Error', () => {
     });
 
     it('should print stack trace with SLS_DEBUG', () => {
-      process.env.SLS_DEBUG = 1;
-      const error = new ServerlessError('a message');
-      logError(error);
+      const BK_SLS_DEBUG = process.env.SLS_DEBUG;
+      process.env.SLS_DEBUG = '1';
+      try {
+        const error = new ServerlessError('a message');
+        logError(error);
 
-      const message = consoleLogSpy.args.join('\n');
+        const message = consoleLogSpy.args.join('\n');
 
-      expect(consoleLogSpy.called).to.equal(true);
-      expect(message).to.have.string('Stack Trace');
-      expect(message).to.have.string(error.stack);
+        expect(consoleLogSpy.called).to.equal(true);
+        expect(message).to.have.string('Stack Trace');
+        expect(message).to.have.string(error.stack);
+      } finally {
+        if (BK_SLS_DEBUG) process.env.SLS_DEBUG = BK_SLS_DEBUG;
+        else delete process.env.SLS_DEBUG;
+      }
     });
 
     it('should not print stack trace without SLS_DEBUG', () => {
Ensure to not pollute process.env