chore: improve test coverage (#1430)

Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
This commit is contained in:
Tonye Jack
2023-08-03 13:25:35 -06:00
committed by GitHub
parent 948fd1aec0
commit 85c8b8252f
5 changed files with 671 additions and 54 deletions

View File

@@ -166,15 +166,15 @@ function* getChangeTypeFilesGenerator({
}): Generator<string> {
for (const changeType of changeTypes) {
const files = changedFiles[changeType] || []
for (const file of files) {
for (const filePath of files) {
if (inputs.dirNames) {
yield getDirnameMaxDepth({
pathStr: file,
relativePath: filePath,
dirNamesMaxDepth: inputs.dirNamesMaxDepth,
excludeCurrentDir: inputs.dirNamesExcludeCurrentDir
})
} else {
yield file
yield filePath
}
}
}
@@ -213,15 +213,15 @@ function* getAllChangeTypeFilesGenerator({
inputs: Inputs
changedFiles: ChangedFiles
}): Generator<string> {
for (const file of flatten(Object.values(changedFiles))) {
for (const filePath of flatten(Object.values(changedFiles))) {
if (inputs.dirNames) {
yield getDirnameMaxDepth({
pathStr: file,
relativePath: filePath,
dirNamesMaxDepth: inputs.dirNamesMaxDepth,
excludeCurrentDir: inputs.dirNamesExcludeCurrentDir
})
} else {
yield file
yield filePath
}
}
}