mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-10 02:30:39 +01:00
test(cso): set GSTACK_HOME in beforeAll, not at module scope
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
68aafed466
commit
1aefb06773
1 file changed
+5
-2
@@ -21,8 +21,11 @@ const OLD_CANARY = ['ghp_', 'zyxwvutsrqponmlkjihgfedcba0987654321'].join('');
|
||||
const MARKER = '[gstack-cso history truncated:';
|
||||
const roots: string[] = [];
|
||||
const originalHome = process.env.GSTACK_HOME;
|
||||
const state = fs.realpathSync(fs.mkdtempSync(path.join(os.tmpdir(), 'cso-ordinary-state-')));
|
||||
process.env.GSTACK_HOME = state;
|
||||
let state = '';
|
||||
beforeAll(() => {
|
||||
state = fs.realpathSync(fs.mkdtempSync(path.join(os.tmpdir(), 'cso-ordinary-state-')));
|
||||
process.env.GSTACK_HOME = state;
|
||||
});
|
||||
afterEach(() => {
|
||||
for (const root of roots.splice(0)) fs.rmSync(root, { recursive: true, force: true });
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user