MCPcopy Create free account
hub / github.com/tensorflow/tfjs / findTestFiles

Function findTestFiles

tfjs-react-native/scripts/enumerate-tests.js:49–62  ·  view source on GitHub ↗
(dir, files)

Source from the content-addressed store, hash-verified

47const argv = require('yargs').argv;
48
49function findTestFiles(dir, files) {
50 files = files || [];
51 fs.readdirSync(dir).forEach(file => {
52 const filePath = path.join(dir, file);
53 if (!file.endsWith('node_modules') && !file.startsWith('.') &&
54 fs.statSync(filePath).isDirectory() &&
55 !fs.existsSync(path.join(filePath, 'package.json'))) {
56 files = findTestFiles(filePath, files);
57 } else if (filePath.endsWith('test.ts')) {
58 files.push(filePath.replace('src/', './').replace('.ts', ''));
59 }
60 });
61 return files;
62};
63
64let files = findTestFiles('./src');
65files = files.map(f => `import '${f}';`);

Callers 1

enumerate-tests.jsFile · 0.85

Calls 2

joinMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…