MCPcopy
hub / github.com/rollup/rollup / runTestsInDirectory

Function runTestsInDirectory

test/testHelpers.js:253–270  ·  view source on GitHub ↗

* @template {TestConfigBase} C * @param {string} directory * @param {(directory: string, config: C) => void} runTest

(directory, runTest)

Source from the content-addressed store, hash-verified

251 * @param {(directory: string, config: C) => void} runTest
252 */
253function runTestsInDirectory(directory, runTest) {
254 const fileNames = getFileNamesAndRemoveOutput(directory);
255 if (fileNames.includes('_config.js')) {
256 loadConfigAndRunTest(directory, runTest);
257 } else if (fileNames.length === 0) {
258 console.warn(`Removing empty test directory ${directory}`);
259 rmSync(directory, {
260 force: true,
261 recursive: true
262 });
263 } else {
264 describe(path.basename(directory), () => {
265 for (const fileName of fileNames.filter(name => name[0] !== '.').sort()) {
266 runTestsInDirectory(path.join(directory, fileName), runTest);
267 }
268 });
269 }
270}
271
272/**
273 * @param {string} directory

Callers 1

runSamplesFunction · 0.85

Calls 3

loadConfigAndRunTestFunction · 0.85
basenameMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…