mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-02 03:35:09 +02:00
Fix gbrain config isolation test
This commit is contained in:
@@ -97,11 +97,13 @@ describe('gstack-config gbrain keys', () => {
|
||||
});
|
||||
|
||||
test('GSTACK_HOME overrides real config dir', () => {
|
||||
run(['gstack-config', 'set', 'gbrain_sync_mode', 'full']);
|
||||
// Real ~/.gstack/config.yaml must NOT have been touched.
|
||||
// Real ~/.gstack/config.yaml must not change, regardless of what it
|
||||
// already contains on the developer's machine.
|
||||
const realConfig = path.join(os.homedir(), '.gstack', 'config.yaml');
|
||||
const real = fs.existsSync(realConfig) ? fs.readFileSync(realConfig, 'utf-8') : '';
|
||||
expect(real).not.toContain('gbrain_sync_mode: full');
|
||||
const before = fs.existsSync(realConfig) ? fs.readFileSync(realConfig, 'utf-8') : null;
|
||||
run(['gstack-config', 'set', 'gbrain_sync_mode', 'full']);
|
||||
const after = fs.existsSync(realConfig) ? fs.readFileSync(realConfig, 'utf-8') : null;
|
||||
expect(after).toBe(before);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user