Add env and debug mode tests

This commit is contained in:
Girish Ramakrishnan
2019-09-09 15:35:02 -07:00
parent 801ca7eda1
commit 5f9b2f1159
3 changed files with 156 additions and 4 deletions

View File

@@ -287,7 +287,7 @@ function setEnvironment(req, res, next) {
assert.strictEqual(typeof req.params.id, 'string');
if (!req.body.env || typeof req.body.env !== 'object') return next(new HttpError(400, 'env must be an object'));
if (Object.keys(req.body.env).some(function (key) { return typeof req.body.env[key] !== 'string'; })) return next(new HttpError(400, 'env must contain values as strings'));
if (Object.keys(req.body.env).some((key) => typeof req.body.env[key] !== 'string')) return next(new HttpError(400, 'env must contain values as strings'));
apps.setEnvironment(req.params.id, req.body.env, auditSource.fromRequest(req), function (error, result) {
if (error) return next(toHttpError(error));