Skip to content

Commit

Permalink
fix: tests ignore none code files persian test
Browse files Browse the repository at this point in the history
  • Loading branch information
hosseinmd committed Feb 9, 2022
1 parent c0b4295 commit 210441c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/tests/src/persianChars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ function recursiveChecker(
componentDir: string,
resolver: (...dirs: string[]) => string,
) {
const regex = /.(ts|js|tsx|jsx)$/;

const files = fs.readdirSync(resolver(componentDir));
files.forEach((file) => {
if (fs.lstatSync(resolver(componentDir, file)).isDirectory()) {
Expand All @@ -21,15 +19,17 @@ function recursiveChecker(
) {
return;
}
if (!regex.test(file)) {
return;
}

recursiveChecker(resolver(componentDir, file), resolver);
return;
}
const regexCodeFiles = /.(ts|js|tsx|jsx)$/;

if (!regexCodeFiles.test(file)) {
return;
}

if (/\.test\.tsx?$/g.test(file) && /\.d\.tsx?$/g.test(file)) {
if (/\.(test|spec)\.(t|j)sx?$/g.test(file) && /\.d\.tsx?$/g.test(file)) {
return;
}

Expand Down

0 comments on commit 210441c

Please sign in to comment.