test(phase4): provision overseas lifecycle fixtures

This commit is contained in:
2026-08-24 15:07:17 +08:00
parent cd97229791
commit e11a528dfe
12 changed files with 248 additions and 48 deletions
+6 -2
View File
@@ -61,6 +61,10 @@ export function normalizeModuleOrder(modules) {
normalized.splice(normalized.indexOf('phase3-loading-finalize') + 1, 0, 'phase3-order-splitting')
}
}
if (normalized.includes('phase4-overseas-business')
&& !normalized.includes('merchant-qualification-fixture')) {
normalized.splice(normalized.indexOf('phase4-overseas-business'), 0, 'merchant-qualification-fixture')
}
const financeChain = ['finance-full-fixtures', 'finance-reconciliation-full', 'finance-settlement-full']
const firstFinanceIndex = normalized.findIndex((name) => financeChain.includes(name))
if (firstFinanceIndex >= 0) {
@@ -229,9 +233,9 @@ export class AcceptanceRun {
return { method, path, http: 0, body: null, raw: error instanceof Error ? error.message : String(error), requestId: null, traceId: null }
}
}
async requestOverseas(method, path, body = undefined, extraHeaders = {}) {
async requestOverseas(method, path, body = undefined, extraHeaders = {}, token = this.overseasToken) {
const headers = { Accept: 'application/json', ...extraHeaders }
if (this.overseasToken) headers.Authorization = `Bearer ${this.overseasToken}`
if (token) headers.Authorization = `Bearer ${token}`
if (body !== undefined) headers['Content-Type'] = 'application/json; charset=utf-8'
try {
const response = await fetch(`${this.options.overseasGateway}${path}`, {