test: run visibility-state-spec.ts first (#44206)

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
This commit is contained in:
John Kleinschmidt 2024-10-14 09:40:22 -04:00 committed by GitHub
parent 566c72cd46
commit 48156aee06
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 10 deletions

View file

@ -149,7 +149,17 @@ app.whenReady().then(async () => {
const { getFiles } = require('./get-files');
const testFiles = await getFiles(__dirname, filter);
for (const file of testFiles.sort()) {
const VISIBILITY_SPEC = ('visibility-state-spec.ts');
const sortedFiles = testFiles.sort((a, b) => {
// If visibility-state-spec is in the list, move it to the first position
// so that it gets executed first to avoid other specs interferring with it.
if (a.indexOf(VISIBILITY_SPEC) > -1) {
return -1;
} else {
return a.localeCompare(b);
}
});
for (const file of sortedFiles) {
mocha.addFile(file);
}