Skip to content

Commit

Permalink
chore: Additionally sort by file name if 'conf.glossaries' index isn'…
Browse files Browse the repository at this point in the history
…t decisive (#194)

...to gain reproducable test results and avoid random test failures.
  • Loading branch information
about-code committed Oct 14, 2021
1 parent 5fbcc23 commit f236097
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/model/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,12 @@ function unglobGlossaries(context) {
// In terms of options like 'termHints', 'exports', only one wins.
const keys = {};
return confsAll
.sort((c1, c2) => c2.arrIdx - c1.arrIdx)
.sort((c1, c2) => {
const byPos = c2.arrIdx - c1.arrIdx;
return byPos === 0
? c2.file.localeCompare(c1.file.length, "en")
: byPos;
})
.filter(conf => {
const filePath = conf.file;
if (keys[filePath]) {
Expand Down

0 comments on commit f236097

Please sign in to comment.