overleaf/server-ce/test/helpers/config.ts
Jakob Ackermann 5a1cff55bc Merge pull request #18543 from overleaf/jpa-server-pro-test-templates
[server-pro] tests: add tests for templates feature

GitOrigin-RevId: b36482af924e306207cbdedc1a8d1d548272ee77
2024-05-30 08:05:30 +00:00

22 lines
460 B
TypeScript

import { reconfigure } from './hostAdminClient'
let lastConfig: string
export function startWith({
pro = false,
version = 'latest',
vars = {},
varsFn = () => ({}),
}) {
before(async function () {
Object.assign(vars, varsFn())
const cfg = JSON.stringify({ pro, version, vars })
if (lastConfig === cfg) return
this.timeout(100 * 1000)
await reconfigure({ pro, version, vars })
lastConfig = cfg
})
}
export { reconfigure }