统一前后端代码格式化配置

This commit is contained in:
yml2213
2026-08-16 17:27:12 +08:00
parent 8705f6a6a1
commit 5c7c3e14e3
278 changed files with 6386 additions and 5500 deletions
@@ -64,43 +64,56 @@ test('resolveKuaishouFeifeiH5UrlWithUid appends uid query', () => {
test('buildFeifeiPlatformOrderNo prefers source order number', () => {
assert.equal(
buildFeifeiPlatformOrderNo(createTask({
platform_order_id: 'KS202607080001',
task_no: 'DT600a8bd23b8',
})),
buildFeifeiPlatformOrderNo(
createTask({
platform_order_id: 'KS202607080001',
task_no: 'DT600a8bd23b8',
}),
),
'KS202607080001',
)
})
test('buildFeifeiPlatformOrderNo falls back to task number', () => {
assert.equal(
buildFeifeiPlatformOrderNo(createTask({
platform_order_id: '',
task_no: 'DT600a8bd23b8',
})),
buildFeifeiPlatformOrderNo(
createTask({
platform_order_id: '',
task_no: 'DT600a8bd23b8',
}),
),
'DT600a8bd23b8',
)
})
test('resolveKuaishouFeifeiPlatformAmount converts order fen amount to yuan', () => {
assert.equal(resolveKuaishouFeifeiPlatformAmount({
totalAmountFen: 3800,
quantity: 1,
}), 38)
assert.equal(
resolveKuaishouFeifeiPlatformAmount({
totalAmountFen: 3800,
quantity: 1,
}),
38,
)
})
test('resolveKuaishouFeifeiPlatformAmount splits amount by item quantity', () => {
assert.equal(resolveKuaishouFeifeiPlatformAmount({
totalAmountFen: 7600,
quantity: 2,
}), 38)
assert.equal(
resolveKuaishouFeifeiPlatformAmount({
totalAmountFen: 7600,
quantity: 2,
}),
38,
)
})
test('resolveKuaishouFeifeiPlatformAmount skips empty amount', () => {
assert.equal(resolveKuaishouFeifeiPlatformAmount({
totalAmountFen: 0,
quantity: 1,
}), 0)
assert.equal(
resolveKuaishouFeifeiPlatformAmount({
totalAmountFen: 0,
quantity: 1,
}),
0,
)
})
function createTask(patch: Partial<TaskRow> = {}): TaskRow {