-
Notifications
You must be signed in to change notification settings - Fork 3
Add extensions
option for TypeScript support and other extensions in the future
#9
Conversation
There are more places here where We also need to decide whether |
Ah, got it. I just did a check, and list the following parts need to add
About whether Which one do you prefer, replace or additional? |
Thinking about it more, replacing makes the most sense here. Why would you even use |
Ok, so both of us agree to use replace. I'll try to modify the code later, get rid of all part of the hard coded .js, and start using |
extensions
for TypeScript Support(and other extension names in the future)extensions
option for TypeScript support and other extensions in the future
extensions
option for TypeScript support and other extensions in the futureextensions
option for TypeScript support and other extensions in the future
|
||
if (process.platform === 'win32') { | ||
// Always use / in patterns, harmonizing matching across platforms. | ||
pattern = slash(pattern); | ||
// pattern = slash(pattern); | ||
patternList = patternList.map(function (p) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be the same as patternList.map(slash);
no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, you are right, it's the same. thanks!
'test.js', | ||
'test-*.js', | ||
function defaultIncludePatterns(extensions) { | ||
var patternList = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imo it could just be patterns
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
@@ -241,14 +266,20 @@ function handlePaths(files, excludePatterns, globOptions) { | |||
|
|||
searchedParents[file] = true; | |||
|
|||
var pattern = path.join(file, '**', '*.js'); | |||
// var pattern = path.join(file, '**', '*.js'); | |||
var patternList = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
patterns
too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done too.
// var pattern = path.join(file, '**', '*.js'); | ||
var patternList = []; | ||
globOptions.extensions.forEach(function (ext) { | ||
patternList.push(path.join(file, '**', '*.' + ext)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistency between https://github.com/avajs/ava-files/pull/9/files#diff-168726dbe96b3ce427e7fedce31bb0bcR187. path.join()
is used here, unlike in that other place. I think it should be used in both places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although, since we are using slash()
, path.join()
is not necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -269,6 +300,16 @@ function handlePaths(files, excludePatterns, globOptions) { | |||
}); | |||
} | |||
|
|||
function validFileName(file, extensions) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isValidFileName
would be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
const files = await avaFiles.findTestFiles(); | ||
const expected = [ | ||
'typescript.ts' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be on the same line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
const files = await avaFiles.findTestFiles(); | ||
const expected = [ | ||
'typescript.ts' | ||
].map(function (file) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be an arrow function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Hey @vdemedes , Thanks for the review, I had followed your suggestions and made a new push. |
I would be more confident in this change if it had more tests. |
There's lot of commented code left in there. Please always review the diff before pushing changes. |
Sorry for the commented code because I use them to compare the code at first, and forgot to clean them. Just cleaned them all. About the tests, I added a new test with empty What kind of tests do you think we need to add more? I can follow you, but now I can only think about test |
Follow avajs/ava#1109