Skip to content

Commit

Permalink
fix: remove any jest config files
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Mar 22, 2021
1 parent 124a586 commit 01838a6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions core/jest-testing/src/related-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@ export const runRelatedTests = async (
`${fileDir}${path.sep}${name}*.@(test|spec).@(j|t)s?(x)`,
`${fileDir}${path.sep}__tests__${path.sep}**${path.sep}*.@(j|t)s?(x)`,
];
const testFiles = globs.reduce(
(acc: string[], match) => [...acc, ...globSync(match, { nocase: true })],
[],
);
const testFiles = globs.reduce((acc: string[], match) => {
const files = globSync(match, { nocase: true });
const newFiles = files.filter(file => {
return path.basename(file) !== 'jest.config.js';
});
return [...acc, ...newFiles];
}, []);

const results: RelatedTests = await Promise.all(
testFiles.map(async testFile => {
const rootDir = path.relative(
Expand Down

0 comments on commit 01838a6

Please sign in to comment.