skip production data dir creation (#1164)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { homedir } from 'os'
|
||||
import { join, resolve } from 'path'
|
||||
import { getListenHost, getWebUiDataDir, getWebUiHome } from '../../packages/server/src/config'
|
||||
import { getListenHost, getWebUiHome, shouldCreateWebUiDataDir } from '../../packages/server/src/config'
|
||||
|
||||
describe('server config', () => {
|
||||
it('defaults to an IPv4 bind host', () => {
|
||||
@@ -28,7 +28,8 @@ describe('server config', () => {
|
||||
expect(getWebUiHome({ HERMES_WEBUI_STATE_DIR: ' ./tmp/hermes-state ' })).toBe(resolve('./tmp/hermes-state'))
|
||||
})
|
||||
|
||||
it('keeps runtime data under the web-ui home', () => {
|
||||
expect(getWebUiDataDir({ HERMES_WEB_UI_HOME: ' ./tmp/hermes-ui ' })).toBe(resolve('./tmp/hermes-ui/data'))
|
||||
it('only creates the development data directory outside production', () => {
|
||||
expect(shouldCreateWebUiDataDir({ NODE_ENV: 'development' })).toBe(true)
|
||||
expect(shouldCreateWebUiDataDir({ NODE_ENV: 'production' })).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user