Backport #27102 by @silverwind Enable [globals](https://vitest.dev/config/#globals) in vitest, reducing the noise in test files. Co-authored-by: silverwind <me@silverwind.io>
Fixes: https://github.com/go-gitea/gitea/issues/21722 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>