overleaf/server-ce/test/helpers/config.ts
Miguel Serrano 30a64401b2 [SP] e2e tests for SAML/LDAP (#19182)
* [SP] e2e tests for SAML/LDAP

* [server-pro] tests: prefetch ldap and saml docker images

---------

Co-authored-by: Jakob Ackermann <jakob.ackermann@overleaf.com>
GitOrigin-RevId: 64298df3f3941a8267a8aacd431757d21b43c75b
2024-07-02 08:05:14 +00:00

31 lines
633 B
TypeScript

import { reconfigure } from './hostAdminClient'
export const STARTUP_TIMEOUT =
parseInt(Cypress.env('STARTUP_TIMEOUT'), 10) || 120_000
let lastConfig: string
export function startWith({
pro = false,
version = 'latest',
vars = {},
varsFn = () => ({}),
withDataDir = false,
}) {
before(async function () {
Object.assign(vars, varsFn())
const cfg = JSON.stringify({
pro,
version,
vars,
withDataDir,
})
if (lastConfig === cfg) return
this.timeout(STARTUP_TIMEOUT)
await reconfigure({ pro, version, vars, withDataDir })
lastConfig = cfg
})
}
export { reconfigure }