make web ui state directory configurable (#764)
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { getListenHost } from '../../packages/server/src/config'
|
||||
import { homedir } from 'os'
|
||||
import { join, resolve } from 'path'
|
||||
import { getListenHost, getWebUiHome } from '../../packages/server/src/config'
|
||||
|
||||
describe('server config', () => {
|
||||
it('defaults to an IPv4 bind host', () => {
|
||||
@@ -13,4 +15,16 @@ describe('server config', () => {
|
||||
it('ignores blank BIND_HOST values', () => {
|
||||
expect(getListenHost({ BIND_HOST: ' ' })).toBe('0.0.0.0')
|
||||
})
|
||||
|
||||
it('defaults web-ui home to ~/.hermes-web-ui', () => {
|
||||
expect(getWebUiHome({})).toBe(join(homedir(), '.hermes-web-ui'))
|
||||
})
|
||||
|
||||
it('uses HERMES_WEB_UI_HOME when provided', () => {
|
||||
expect(getWebUiHome({ HERMES_WEB_UI_HOME: ' ./tmp/hermes-ui ' })).toBe(resolve('./tmp/hermes-ui'))
|
||||
})
|
||||
|
||||
it('uses HERMES_WEBUI_STATE_DIR as a compatibility alias', () => {
|
||||
expect(getWebUiHome({ HERMES_WEBUI_STATE_DIR: ' ./tmp/hermes-state ' })).toBe(resolve('./tmp/hermes-state'))
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user