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

Function getTestsFor

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

* Retrieves the set of unit tests that should be run * for a set of source files. * * @param {string[]} srcFiles * @return {string[]}

(srcFiles)

Source from the content-addressed store, hash-verified

225 * @return {string[]}
226 */
227 function getTestsFor(srcFiles) {
228 const allUnitTests = fastGlob.sync(unitTestPaths);
229 return allUnitTests.filter((testFile) => {
230 return shouldRunTest(testFile, srcFiles);
231 });
232 }
233
234 filesChanged.forEach((file) => {
235 if (!fs.existsSync(file)) {

Callers 1

unitTestsToRunFunction · 0.85

Calls 3

shouldRunTestFunction · 0.85
syncMethod · 0.80
filterMethod · 0.45

Tested by

no test coverage detected