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