diff --git a/lib/unexpectedMitm.js b/lib/unexpectedMitm.js
index <HASH>..<HASH> 100644
--- a/lib/unexpectedMitm.js
+++ b/lib/unexpectedMitm.js
@@ -757,7 +757,7 @@ module.exports = {
                 expect.errorMode = 'nested';
                 var testFile = filePathWithoutExt + '.js';
 
-                if (process.env.UNEXPECTED_MITM_WRITE === 'true') {
+                if (checkEnvFlag('UNEXPECTED_MITM_WRITE')) {
                     return executeMitm(expect, subject).spread(function (fulfilmentValue, recordedExchanges) {
                         var output = 'module.exports = ' +  stringify(recordedExchanges) + ';\n';
Use the common var checking function.