Skip to content

Commit

Permalink
Tests: Test discovery should ignore unsupported file extensions (#2886)
Browse files Browse the repository at this point in the history
  • Loading branch information
RunDevelopment authored May 3, 2021
1 parent 5315140 commit 4492c5c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/helper/test-discovery.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const fs = require('fs');
const path = require('path');

const SUPPORTED_TEST_FILE_EXT = new Set('.js', '.test');

module.exports = {

Expand Down Expand Up @@ -94,7 +95,8 @@ module.exports = {
getAllFiles(src) {
return fs.readdirSync(src)
.filter(fileName => {
return fs.statSync(path.join(src, fileName)).isFile();
return SUPPORTED_TEST_FILE_EXT.has(path.extname(fileName))
&& fs.statSync(path.join(src, fileName)).isFile();
})
.map(fileName => {
return path.join(src, fileName);
Expand Down

0 comments on commit 4492c5c

Please sign in to comment.