fix(paths): treat empty DSH_HOME as unset; isolate telemetry env test
Review fixes for #462: - resolveDshHome now treats an empty or whitespace-only $DSH_HOME as unset, so a blank override never resolves the home to cwd via resolve(''). Restores the guard telemetry's old resolver carried. - The default-env telemetry test asserts only that globalConfigDir() returns an absolute path, so a machine DSH_HOME without a .dsh suffix cannot break it.
This commit is contained in:
@@ -33,6 +33,11 @@ describe('dsh path helpers', () => {
|
||||
expect(resolveDshHome(undefined, {})).toBe(defaultDshHome())
|
||||
})
|
||||
|
||||
it('treats an empty or whitespace-only DSH_HOME as unset', () => {
|
||||
expect(resolveDshHome(undefined, { DSH_HOME: '' })).toBe(defaultDshHome())
|
||||
expect(resolveDshHome(undefined, { DSH_HOME: ' ' })).toBe(defaultDshHome())
|
||||
})
|
||||
|
||||
it('labels a resolved home by whether it is the default root', () => {
|
||||
expect(dshHomeDisplay(resolve(defaultDshHome()))).toBe('~/.dsh')
|
||||
expect(dshHomeDisplay('/some/other/root')).toBe('$DSH_HOME')
|
||||
|
||||
Reference in New Issue
Block a user