[test] Add db table absence test; Remove useless isServerStartedUp

This commit is contained in:
Sergey Konovalov
2024-03-24 12:32:47 +03:00
parent 2b9f7fd7cd
commit f1ba950b2f
2 changed files with 6 additions and 3 deletions

View File

@ -155,7 +155,6 @@ const EditorTypes = {
const defaultHttpPort = 80, defaultHttpsPort = 443; // Default ports (for http and https)
const editorData = new editorDataStorage();
const clientStatsD = statsDClient.getClient();
let isServerStartedUp = false;
let connections = []; // Active connections
let lockDocumentsTimerId = {};//to drop connection that can't unlockDocument
let pubsub;
@ -3971,7 +3970,6 @@ exports.install = function(server, callbackFunction) {
editorData.connect().then(
() => {
callbackFunction();
isServerStartedUp = true;
},
error => operationContext.global.logger.error('editorData error: %s', error.stack)
);
@ -4030,7 +4028,7 @@ exports.healthCheck = function(req, res) {
}
ctx.logger.debug('healthCheck storage');
output = isServerStartedUp;
output = true;
ctx.logger.info('healthCheck end');
} catch (err) {
ctx.logger.error('healthCheck error %s', err.stack);

View File

@ -230,6 +230,11 @@ describe('Base database connector', function () {
}
});
}
const table = "unused_table";
test(`${table} table absence`, async function () {
const result = await baseConnector.getTableColumns(ctx, table);
expect(result).toEqual([]);
});
});
describe('Changes manipulations', function () {