chore(前端): 删除已停用的旧 JS,模板只留 bundle + 5 个外部脚本
- static/js 删除 map.js / navigation.js / share.js / subscribe.js / src/core/geo.js (线上已切 dist/app.js;geo.js 的实现 bundle 内自带) - 这 4 个旧文件移入 tests/fixtures/legacy-js 作为冻结快照: test_order_return.cjs / test_map_refresh.cjs / test_ring_all_frontend.py 仍在读它们, 避免删代码同时丢断言;目录内 README 说明「不要改、改 src-ts 后同步」 - templates/map.html 去掉 geo.js 引用;MAP_ASSETS 同步 - static/js 现在只剩第三方与被引用的 5 个: qrcode.min.js / coordtransform.js / ui-motion.js / bike-clusters.js / settings-pages.js 验证:167 pytest(连跑 2 次)+ 32 node 全绿;浏览器实测 498 辆车、 页面只加载 6 个自有脚本、JS 异常 0
This commit is contained in:
@@ -4,8 +4,10 @@ import unittest
|
||||
|
||||
class RingAllFrontendAuthTests(unittest.TestCase):
|
||||
def test_ring_all_request_sends_session_token(self):
|
||||
# 前端已迁到 TypeScript(src-ts)+ esbuild 产物;这里断言的是请求形状,
|
||||
# 读冻结的旧版快照(tests/fixtures/legacy-js),改 src-ts 时同步改快照。
|
||||
source = (
|
||||
Path(__file__).resolve().parents[1] / "static" / "js" / "map.js"
|
||||
Path(__file__).resolve().parent / "fixtures" / "legacy-js" / "map.js"
|
||||
).read_text(encoding="utf-8")
|
||||
request_block = source.split('fetch("/api/ring_all"', 1)[1].split(");", 1)[0]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user