mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-09-01 11:33:44 +00:00
22 lines
879 B
JavaScript
22 lines
879 B
JavaScript
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
describe('Experimental server configuration', () => {
|
|
const source = fs.readFileSync(path.join(__dirname, 'experimental.js'), 'utf8');
|
|
|
|
it('configures HTTP timeouts for each cluster worker server', () => {
|
|
const listenIndex = source.indexOf('const server = app.listen');
|
|
const timeoutConfigIndex = source.indexOf('configureServerTimeouts(server);');
|
|
|
|
expect(listenIndex).toBeGreaterThan(-1);
|
|
expect(timeoutConfigIndex).toBeGreaterThan(-1);
|
|
expect(listenIndex).toBeLessThan(timeoutConfigIndex);
|
|
});
|
|
|
|
it('runs cross-tenant startup work in the system context', () => {
|
|
expect(source).toContain('await runAsSystem(seedDatabase);');
|
|
expect(source).toMatch(
|
|
/await runAsSystem\(async \(\) => \{\s+await performStartupChecks\(appConfig\);\s+await updateInterfacePerms/,
|
|
);
|
|
});
|
|
});
|