v6.x backport - test: convert var->const/let in tests
I'll fix up the commit messages once the tests are passing. EDIT: They are.
Backport of #10685, I couldn't cherry-pick as it brought in hundreds of unrelated changes, so I redid the eslint --fix and manual fixup for v6.x.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines
Affected core subsystem(s)
test, tools