fix(test): 修正大厅价格路由测试的 Windows 路径分隔符断言
This commit is contained in:
@@ -47,12 +47,13 @@ test('所有直接写 open 的接单仓库调用都必须先物化大厅价格',
|
|||||||
source.lastIndexOf('\nfunction ', matchIndex),
|
source.lastIndexOf('\nfunction ', matchIndex),
|
||||||
)
|
)
|
||||||
const before = source.slice(functionStart, matchIndex)
|
const before = source.slice(functionStart, matchIndex)
|
||||||
|
const relativePath = path.relative(BACKEND_SRC, file).split(path.sep).join('/')
|
||||||
assert.match(
|
assert.match(
|
||||||
before,
|
before,
|
||||||
/assertWorkOrderHallPriceReadyWithClient\s*\(/,
|
/assertWorkOrderHallPriceReadyWithClient\s*\(/,
|
||||||
`${path.relative(BACKEND_SRC, file)} 存在未经大厅价格物化直接写 open 的路径`,
|
`${relativePath} 存在未经大厅价格物化直接写 open 的路径`,
|
||||||
)
|
)
|
||||||
directWrites.push(path.relative(BACKEND_SRC, file))
|
directWrites.push(relativePath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user