feat: add server assembly and stdio entry

This commit is contained in:
smartass
2026-06-12 00:13:10 +05:00
parent 7514aedb1e
commit 6bf2aa74ca
6 changed files with 120 additions and 8 deletions
+22
View File
@@ -0,0 +1,22 @@
import { describe, expect, it } from 'vitest'
import { parseArgs } from '../../src/cli.js'
describe('parseArgs', () => {
it('prefers the --config flag', () => {
expect(parseArgs(['--config', '/tmp/c.json'], { DBMOLE_CONFIG: '/env.json' })).toEqual({
configPath: '/tmp/c.json'
})
})
it('falls back to DBMOLE_CONFIG env', () => {
expect(parseArgs([], { DBMOLE_CONFIG: '/env.json' })).toEqual({ configPath: '/env.json' })
})
it('returns undefined without flag or env', () => {
expect(parseArgs([], {})).toEqual({ configPath: undefined })
})
it('ignores --config without a value', () => {
expect(parseArgs(['--config'], {})).toEqual({ configPath: undefined })
})
})