feat: Add property Parse.Server.version to determine current version of Parse Server in Cloud Code (#8670)
This commit is contained in:
@@ -103,6 +103,14 @@ describe('Cloud Code', () => {
|
||||
expect(currentConfig.silent).toBeFalse();
|
||||
});
|
||||
|
||||
it('can get curent version', () => {
|
||||
const version = require('../package.json').version;
|
||||
const currentConfig = Config.get('test');
|
||||
expect(Parse.Server.version).toBeDefined();
|
||||
expect(currentConfig.version).toBeDefined();
|
||||
expect(Parse.Server.version).toEqual(version);
|
||||
});
|
||||
|
||||
it('show warning on duplicate cloud functions', done => {
|
||||
const logger = require('../lib/logger').logger;
|
||||
spyOn(logger, 'warn').and.callFake(() => {});
|
||||
|
||||
@@ -7,6 +7,7 @@ import net from 'net';
|
||||
import AppCache from './cache';
|
||||
import DatabaseController from './Controllers/DatabaseController';
|
||||
import { logLevels as validLogLevels } from './Controllers/LoggerController';
|
||||
import { version } from '../package.json';
|
||||
import {
|
||||
AccountLockoutOptions,
|
||||
DatabaseOptions,
|
||||
@@ -50,6 +51,7 @@ export class Config {
|
||||
config.generateEmailVerifyTokenExpiresAt = config.generateEmailVerifyTokenExpiresAt.bind(
|
||||
config
|
||||
);
|
||||
config.version = version;
|
||||
return config;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user