Skip to content

Commit 49e803d

Browse files
test(cache): delete the env variable the test set when it was unset before
Assigning an undefined value to process.env stores the string "undefined" and leaves the key present, so the variable leaked out of the test into whatever ran next in the same process.
1 parent 19308a4 commit 49e803d

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎test/PersistentCaching.test.js‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,12 @@ export default FLAG;
765765
);
766766
}
767767
} finally {
768-
process.env.WEBPACK_TEST_INLINE = previous;
768+
// Assigning undefined would leave the string "undefined" behind
769+
if (previous === undefined) {
770+
delete process.env.WEBPACK_TEST_INLINE;
771+
} else {
772+
process.env.WEBPACK_TEST_INLINE = previous;
773+
}
769774
}
770775
}, 120000);
771776

0 commit comments

Comments
 (0)