统一前后端代码格式化配置
This commit is contained in:
@@ -6,11 +6,13 @@ import { resolveTaskDeliveryLink } from './delivery-link-service.js'
|
||||
import type { TaskRow } from '../../types/repository/rows.js'
|
||||
|
||||
test('resolveTaskDeliveryLink 为 cloud 任务返回内部领取链接', async () => {
|
||||
const result = await resolveTaskDeliveryLink(createTask({
|
||||
executor_key: 'kuaishou_ct_assisted',
|
||||
primary_claim_token: 'cloud-token',
|
||||
primary_claim_expires_at: '2026-07-09T00:00:00.000Z',
|
||||
}))
|
||||
const result = await resolveTaskDeliveryLink(
|
||||
createTask({
|
||||
executor_key: 'kuaishou_ct_assisted',
|
||||
primary_claim_token: 'cloud-token',
|
||||
primary_claim_expires_at: '2026-07-09T00:00:00.000Z',
|
||||
}),
|
||||
)
|
||||
|
||||
assert.deepEqual(result, {
|
||||
claimUrl: buildClaimUrl('cloud-token'),
|
||||
@@ -19,11 +21,13 @@ test('resolveTaskDeliveryLink 为 cloud 任务返回内部领取链接', async (
|
||||
})
|
||||
|
||||
test('resolveTaskDeliveryLink 兼容历史 kuaishou-industry cloud 任务', async () => {
|
||||
const result = await resolveTaskDeliveryLink(createTask({
|
||||
executor_key: 'kuaishou-industry',
|
||||
claim_token: 'industry-token',
|
||||
claim_expires_at: '2026-07-09T08:00:00.000Z',
|
||||
}))
|
||||
const result = await resolveTaskDeliveryLink(
|
||||
createTask({
|
||||
executor_key: 'kuaishou-industry',
|
||||
claim_token: 'industry-token',
|
||||
claim_expires_at: '2026-07-09T08:00:00.000Z',
|
||||
}),
|
||||
)
|
||||
|
||||
assert.deepEqual(result, {
|
||||
claimUrl: buildClaimUrl('industry-token'),
|
||||
@@ -32,18 +36,20 @@ test('resolveTaskDeliveryLink 兼容历史 kuaishou-industry cloud 任务', asyn
|
||||
})
|
||||
|
||||
test('resolveTaskDeliveryLink 为 feifei 任务返回本站领取链接', async () => {
|
||||
const result = await resolveTaskDeliveryLink(createTask({
|
||||
executor_key: 'kuaishou_feifei',
|
||||
primary_claim_token: 'feifei-token',
|
||||
primary_claim_expires_at: '2026-07-09T12:00:00.000Z',
|
||||
context_json: {
|
||||
kuaishouFeifei: {
|
||||
h5: {
|
||||
rechargeUrl: 'https://feifei.example.com/h5/bind?code=very-long',
|
||||
const result = await resolveTaskDeliveryLink(
|
||||
createTask({
|
||||
executor_key: 'kuaishou_feifei',
|
||||
primary_claim_token: 'feifei-token',
|
||||
primary_claim_expires_at: '2026-07-09T12:00:00.000Z',
|
||||
context_json: {
|
||||
kuaishouFeifei: {
|
||||
h5: {
|
||||
rechargeUrl: 'https://feifei.example.com/h5/bind?code=very-long',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}))
|
||||
}),
|
||||
)
|
||||
|
||||
assert.deepEqual(result, {
|
||||
claimUrl: buildClaimUrl('feifei-token'),
|
||||
@@ -52,9 +58,11 @@ test('resolveTaskDeliveryLink 为 feifei 任务返回本站领取链接', async
|
||||
})
|
||||
|
||||
test('resolveTaskDeliveryLink 对人工履约任务返回 null', async () => {
|
||||
const result = await resolveTaskDeliveryLink(createTask({
|
||||
executor_key: 'manual_dispatch',
|
||||
}))
|
||||
const result = await resolveTaskDeliveryLink(
|
||||
createTask({
|
||||
executor_key: 'manual_dispatch',
|
||||
}),
|
||||
)
|
||||
|
||||
assert.equal(result, null)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user