feat: add server assembly and stdio entry
This commit is contained in:
@@ -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 })
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user