chore(管理端): 初始化工程仓库

This commit is contained in:
leon_mac
2026-10-18 15:11:44 +08:00
commit dc740e8027
28 changed files with 2206 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
import { test } from 'node:test'
import { strict as assert } from 'node:assert'
import { unwrap, nextStatus } from '../src/contract.ts'
test('HTTP 200 envelopes still reject unauthenticated and forbidden operations',()=>{assert.equal(unwrap({code:200,msg:'ok',data:3}),3); for(let code of [401,403,409]) assert.throws(()=>unwrap({code,msg:'拒绝',data:null}), /拒绝/)})
test('task actions follow pending accepted completed sequence',()=>{assert.equal(nextStatus('pending'),'accepted');assert.equal(nextStatus('accepted'),'completed');assert.equal(nextStatus('completed'),null);assert.equal(nextStatus('cancelled'),null)})