MCPcopy Create free account
hub / github.com/ampproject/amphtml / shouldRunTest

Function shouldRunTest

build-system/tasks/runtime-test/helpers-unit.js:211–218  ·  view source on GitHub ↗

* @param {string} testFile * @param {string[]} srcFiles * @return {boolean}

(testFile, srcFiles)

Source from the content-addressed store, hash-verified

209 * @return {boolean}
210 */
211 function shouldRunTest(testFile, srcFiles) {
212 const filesImported = getImports(testFile);
213 return (
214 filesImported.filter(function (file) {
215 return srcFiles.some((srcFile) => srcFile.includes(file));
216 }).length > 0
217 );
218 }
219
220 /**
221 * Retrieves the set of unit tests that should be run

Callers 1

getTestsForFunction · 0.85

Calls 2

getImportsFunction · 0.85
filterMethod · 0.45

Tested by

no test coverage detected