From 1a0b3b2d3297ae4cc487ec951884cce2aabdcd02 Mon Sep 17 00:00:00 2001 From: Raz Luvaton <16746759+rluvaton@users.noreply.github.com> Date: Tue, 25 Jul 2023 19:33:27 +0300 Subject: [PATCH] revert to log --- test/common/assertSnapshot.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/common/assertSnapshot.js b/test/common/assertSnapshot.js index f27d6155d2a62b..313b06653097c0 100644 --- a/test/common/assertSnapshot.js +++ b/test/common/assertSnapshot.js @@ -39,8 +39,9 @@ async function assertSnapshot(actual, filename = process.argv[1]) { expected = await fs.readFile(snapshot, 'utf8'); } catch (e) { if (e.code === 'ENOENT') { - await fs.writeFile(snapshot, actual); - return; + console.log( + 'Snapshot file does not exist. You can create a new one by running the test with NODE_REGENERATE_SNAPSHOTS=1', + ); } throw e; }