app.ts 461 B

123456789101112
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import type { AppName } from '#shared/types/app.ts'
  3. // internal Vitest variable, ideally should check expect.getState().testPath, but it's not populated in 0.34.6 (a bug)
  4. const { filepath } = (globalThis as any).__vitest_worker__ as any
  5. const isDesktop = filepath.includes('apps/desktop')
  6. export const getTestAppName = (): AppName => {
  7. return isDesktop ? 'desktop' : 'mobile'
  8. }