2026-10-03 17:08:15 +08:00
|
|
|
import test from 'node:test'
|
|
|
|
|
import assert from 'node:assert/strict'
|
2026-10-03 17:12:49 +08:00
|
|
|
import { execute, databaseProfilePath } from './client-xlsx-address-test-env.mjs'
|
2026-10-03 17:08:15 +08:00
|
|
|
test('XLSX rejection plan performs no network or credential reads', async () => {
|
|
|
|
|
assert.equal((await execute(['--plan'], [], {})).plan, true)
|
|
|
|
|
await assert.rejects(execute(['--execute'], [], {}))
|
|
|
|
|
})
|
2026-10-03 17:12:49 +08:00
|
|
|
test('database evidence accepts only the named TEST sibling profile', () => {
|
|
|
|
|
const base = 'C:/Users/test/.codex/env/chongchong-global/test-acceptance.env'
|
|
|
|
|
assert.match(databaseProfilePath('--database-profile=C:/Users/test/.codex/env/chongchong-global/test-database.env', base), /test-database.env$/)
|
|
|
|
|
for (const filename of ['prod-database.env', 'dev-database.env', '../other/test-database.env'])
|
|
|
|
|
assert.throws(() => databaseProfilePath('--database-profile=C:/Users/test/.codex/env/chongchong-global/' + filename, base))
|
|
|
|
|
})
|