/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/configCases/html/output-html-crossorigin/test.js
13 строк
530 B
Alexander Akait
feat(html): generate output.html for entrypoints with dependOn support (#21215)
18 июн 2026, 23:04
Не верифицирован
18 июн 2026, 23:04
868209f
Код
Авторство
О чём код?
const fs = require("fs"); const path = require("path"); const read = (file) => fs.readFileSync(path.resolve(__dirname, file), "utf-8"); const count = (str, sub) => str.split(sub).length - 1; it("mirrors output.crossOriginLoading onto the injected script and stylesheet", () => { const html = read("main.html"); expect(html).toMatch(/src="[^"]+\.js"/); expect(html).toMatch(/href="[^"]+\.css"/); // both the script and the extracted stylesheet carry the attribute expect(count(html, 'crossorigin="anonymous"')).toBe(2); });