/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/configCases/source-map/hidden-source-map-debugids/index.js
14 строк
586 B
Alexander Akait
refactor: improve source type (#20136)
19 ноя 2025, 00:25
Не верифицирован
19 ноя 2025, 00:25
af7d241
Код
Авторство
О чём код?
const fs = require("fs"); it("source should include only debugId comment", function() { const debugIdRegex = new RegExp('[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}', 'i'); const debugIdCommentRegex = new RegExp(`\n\/\/# debugId\s*=\s*${debugIdRegex.source}$`); const source = fs.readFileSync(__filename, "utf-8"); expect(debugIdCommentRegex.test(source)).toBe(true); const sourceMap = fs.readFileSync(__filename + ".map", "utf-8"); const map = JSON.parse(sourceMap); expect(map.debugId).toBeDefined(); expect(debugIdRegex.test(map.debugId)).toBe(true); });