This commit is contained in:
2026-08-13 19:00:33 +08:00
parent 8ba04fc87d
commit cca1bc002e
11 changed files with 253 additions and 80 deletions
@@ -0,0 +1,15 @@
import assert from 'node:assert/strict'
import { readFileSync } from 'node:fs'
import test from 'node:test'
const source = readFileSync(new URL('inbound-measurement.mjs', import.meta.url), 'utf8')
test('measurement acceptance scans the stable box code frozen by first print', () => {
assert.match(source, /const boxCode = `\$\{inboundCode\}#\$\{originalPackageCount\}-1`/)
assert.doesNotMatch(source, /#V\d+#/)
})
test('reprint and Mojia scan share the same frozen box code variable', () => {
assert.match(source, /重复整单打印复用已冻结箱码映射[\s\S]*boxCode=\$\{boxCode\}/)
assert.match(source, /const firstScanResponse = await multipartRequest[\s\S]*boxCode, \.\.\.firstDimensions/)
})