/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/cases/chunks/context-weak/index.js
29 строк
1 KB
Ryuya
chore: update Jest to `v30` (#19604)
12 июн 2025, 15:17
Не верифицирован
12 июн 2025, 15:17
574a887
Код
Авторство
О чём код?
it("should not bundle context requires with asyncMode === 'weak'", function() { var contextRequire = require.context(".", false, /two/, "weak"); expect(function() { contextRequire("./two") }).toThrow(/not available/); }); it("should not bundle context requires with asyncMode === 'weak' using import.meta.webpackContext", function() { const contextRequire = import.meta.webpackContext(".", { recursive: false, regExp: /two/, mode: "weak" }); expect(function() { contextRequire("./two") }).toThrow(/not available/); }); it("should find module with asyncMode === 'weak' when required elsewhere", function() { var contextRequire = require.context(".", false, /.+/, "weak"); expect(contextRequire("./three")).toBe(3); require("./three"); // in a real app would be served as a separate chunk }); it("should find module with asyncMode === 'weak' when required elsewhere (recursive)", function() { var contextRequire = require.context(".", true, /.+/, "weak"); expect(contextRequire("./dir/four")).toBe(4); require("./dir/four"); // in a real app would be served as a separate chunk });