Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion tests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ if(filterPath) {
if(!filterPath.endsWith('.js')) {
testCategories = testCategories.filter(category => category.startsWith(path.basename(filterPath)));
} else {
testCategories = [path.dirname(filterPath).split(path.sep).pop()];
// basename, not split(path.sep): on Windows path.sep is a backslash, so a path typed with
// forward slashes never split and the whole "tests/tests/middlewares" came back as the
// category name. path.basename handles either separator on both platforms
testCategories = [path.basename(path.dirname(filterPath))];
}
}

Expand Down
Loading