/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/configCases/web/prefetch-split-chunks/index.js
15 строк
446 B
Tobias Koppers
fix test case
11 май 2019, 00:37
11 май 2019, 00:37
9bad721
Код
Авторство
О чём код?
import "./public-path"; it("should prefetch correctly", () => { expect(document.head._children).toHaveLength(1); // Test prefetch from entry chunk const link = document.head._children[0]; expect(link._type).toBe("link"); expect(link.rel).toBe("prefetch"); expect(link.href).toBe("https://example.com/public/path/chunk1.js"); if (Math.random() < -1) { import(/* webpackChunkName: "chunk1", webpackPrefetch: true */ "./chunk1"); } });