test(order): verify live import template directories without business writes
This commit is contained in:
@@ -2,21 +2,22 @@ import test from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
import { executionOptions, validatePage, verifyWorkbench } from './client-workbench-test-env.mjs'
|
||||
|
||||
const env = { CHONGCHONG_ENV: 'TEST', CHONGCHONG_MERCHANT_API_BASE_URL: 'https://test.invalid/api', CHONGCHONG_MERCHANT_USERNAME: 'fixture', CHONGCHONG_MERCHANT_PASSWORD: 'fixture' }
|
||||
const env = { CHONGCHONG_ENV: 'TEST', CHONGCHONG_MERCHANT_API_BASE_URL: 'https://test.invalid', CHONGCHONG_MERCHANT_USERNAME: 'fixture', CHONGCHONG_MERCHANT_PASSWORD: 'fixture' }
|
||||
const args = ['--execute', '--environment=TEST', '--run-id=fixture']
|
||||
const execArgs = ['--env-file=C:/Users/BY-OY/.codex/env/chongchong-global/test-acceptance.env']
|
||||
test('plan has no credential or environment dependency', () => {
|
||||
assert.deepEqual(executionOptions([], [], {}), { execute: false })
|
||||
assert.deepEqual(executionOptions(['--plan'], [], {}), { execute: false })
|
||||
})
|
||||
test('execution requires explicit TEST profile, safe run id and API prefix', () => {
|
||||
test('execution requires explicit TEST profile, safe run id and Gateway origin', () => {
|
||||
assert.equal(executionOptions(args, execArgs, env).runId, 'fixture')
|
||||
assert.equal(executionOptions(args, execArgs, env).base, 'https://test.invalid/api')
|
||||
for (const [a, x, e] of [
|
||||
[args, [], env], [args, execArgs, { ...env, CHONGCHONG_ENV: 'PROD' }],
|
||||
[args, [execArgs[0].replace('test-acceptance', 'prod-acceptance')], env],
|
||||
[['--execute', '--environment=TEST', '--run-id=../escape'], execArgs, env],
|
||||
[[...args, '--resume'], execArgs, env],
|
||||
[args, execArgs, { ...env, CHONGCHONG_MERCHANT_API_BASE_URL: 'https://test.invalid/' }],
|
||||
[args, execArgs, { ...env, CHONGCHONG_MERCHANT_API_BASE_URL: 'https://test.invalid/other' }],
|
||||
]) assert.throws(() => executionOptions(a, x, e))
|
||||
})
|
||||
function fixture() {
|
||||
|
||||
Reference in New Issue
Block a user