overleaf/server-ce/test/helpers/config.ts
Jakob Ackermann b75d183cfc Merge pull request #18635 from overleaf/jpa-test-upgrade
[server-pro] add tests for upgrade process

GitOrigin-RevId: eaa1486688cb2fa544adaaee16da04fd757a1b65
2024-06-12 08:04:48 +00:00

23 lines
509 B
TypeScript

import { reconfigure } from './hostAdminClient'
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(100 * 1000)
await reconfigure({ pro, version, vars, withDataDir })
lastConfig = cfg
})
}
export { reconfigure }