mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-03 11:12:07 +00:00
13 lines
329 B
JavaScript
13 lines
329 B
JavaScript
function isTestFile(filePath) {
|
|
const normalizedPath = filePath.replace(/\\/g, '/');
|
|
return (
|
|
/(^|\/)(__tests__|__mocks__|fixtures)(\/|$)/.test(normalizedPath) ||
|
|
/(^|\/)(tests?|test-fixtures)(\/|$)/.test(normalizedPath) ||
|
|
/\.(test|spec)\.[^.]+$/.test(normalizedPath)
|
|
);
|
|
}
|
|
|
|
module.exports = {
|
|
isTestFile,
|
|
};
|