Sort tests case-insensitively and without "Test.js"

So HiddenBrowserTest.js doesn't run before advancedSearchTest.js and
zoteroPaneTest.js doesn't run before zoteroTest.js
This commit is contained in:
Dan Stillman 2023-12-05 06:42:39 -05:00
parent 51b615c54c
commit ce1bdba37a

View file

@ -234,7 +234,13 @@ if (run && ZoteroUnit.tests) {
testFiles.push(file.leafName);
}
}
testFiles.sort();
testFiles.sort((a, b) => {
a = a.replace(/Test.js$/, '').toLowerCase();
b = b.replace(/Test.js$/, '').toLowerCase();
if (a < b) return -1;
if (a > b) return 1;
return 0;
});
// Find the start and stop files
let startPos = 0;