Skip to content

Commit

Permalink
feat: Add property Parse.Server.version to determine current versio…
Browse files Browse the repository at this point in the history
…n of Parse Server in Cloud Code (#8670)
  • Loading branch information
dblythy committed Jul 5, 2023
1 parent a742656 commit a9d376b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions spec/CloudCode.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {});
Expand Down
2 changes: 2 additions & 0 deletions src/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -50,6 +51,7 @@ export class Config {
config.generateEmailVerifyTokenExpiresAt = config.generateEmailVerifyTokenExpiresAt.bind(
config
);
config.version = version;
return config;
}

Expand Down

0 comments on commit a9d376b

Please sign in to comment.