The solution was to just not call beforeAll during setupAfterEnv , and instead do the check as part of the actual tests. The OS dialogs are a bit unreliable in the Azure DevOPs pipeline macOS environment, though.
beforeAll
setupAfterEnv