oneuptime/init-script/tests/end.test.js
2020-02-27 14:15:46 +03:00

20 lines
524 B
JavaScript

/* eslint-disable no-undef */
const PKG_VERSION = require('../package.json').version;
const { mockDbCollection } = require('./helper');
const util = require('../util/db');
const update = jest.spyOn(util, 'update');
const end = require('../scripts/end');
test('Should update GlobalConfig record with name "version" to package version', async () => {
mockDbCollection();
await end();
expect(update).toBeCalledWith(
'GlobalConfig',
{ name: 'version' },
{ value: PKG_VERSION }
);
});