MCPcopy
hub / github.com/webpack/webpack / describeCases

Function describeCases

test/TestCases.template.js:86–552  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

84 * @param {SuiteConfig} config suite config
85 */
86const describeCases = (config) => {
87 describe(config.name, () => {
88 /** @type {ReturnType<typeof captureStdio>} */
89 let stderr;
90
91 beforeEach(() => {
92 stderr = captureStdio(process.stderr, true);
93 });
94
95 afterEach(() => {
96 stderr.restore();
97 });
98
99 for (const category of categories) {
100 // eslint-disable-next-line no-loop-func
101 describe(category.name, () => {
102 jest.setTimeout(30000);
103
104 for (const testName of category.tests.filter((test) => {
105 const testDirectory = path.join(casesPath, category.name, test);
106 const filterPath = path.join(testDirectory, "test.filter.js");
107 if (fs.existsSync(filterPath) && !require(filterPath)(config)) {
108 // eslint-disable-next-line jest/no-disabled-tests
109 describe.skip(test, () => {
110 it("filtered", () => {});
111 });
112
113 return false;
114 }
115 return true;
116 })) {
117 /** @type {string[]} */
118 const infraStructureLog = [];
119 /** @type {string[]} */
120 const infraStructureErrors = [];
121
122 // eslint-disable-next-line no-loop-func
123 describe(testName, () => {
124 const testDirectory = path.join(casesPath, category.name, testName);
125 const outputDirectory = path.join(
126 __dirname,
127 "js",
128 config.name,
129 category.name,
130 testName
131 );
132 const cacheDirectory = path.join(
133 __dirname,
134 "js/.cache",
135 config.name,
136 category.name,
137 testName
138 );
139 /** @type {TestConfig} */
140 let testConfig = {
141 findBundle(_, options) {
142 const ext = path.extname(
143 parseResource(options.output.filename).path

Calls 15

beforeAllFunction · 0.85
afterAllFunction · 0.85
getNumberOfTestsFunction · 0.85
tapMethod · 0.80
runBundlesMethod · 0.80
mergeModuleScopeMethod · 0.80
requireFunction · 0.70
createLoggerFunction · 0.70
runFunction · 0.70
beforeEachFunction · 0.50
afterEachFunction · 0.50
itFunction · 0.50

Tested by

no test coverage detected