From ed36397e920701b2970589d958caa328b5e7b2e3 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Thu, 13 Feb 2025 13:29:20 -0800 Subject: [PATCH] chore: ensure tests correctly mock environment variables before loading opts.js --- test/opts.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/opts.js b/test/opts.js index 12f1fbb..dc2451f 100644 --- a/test/opts.js +++ b/test/opts.js @@ -7,12 +7,13 @@ const mockFs = { readFileSync: () => '', } -const gitOpts = t.mock('../lib/opts.js', { - 'node:fs': mockFs, -}) +let gitOpts t.beforeEach(() => { backupEnv() + gitOpts = t.mock('../lib/opts.js', { + 'node:fs': mockFs, + }) }) t.afterEach(() => {