replace usage of _.extend with Object.assign

This commit is contained in:
Girish Ramakrishnan
2023-05-25 11:27:23 +02:00
parent 79dd50910c
commit e6ba2a6e7a
15 changed files with 62 additions and 71 deletions
+7 -8
View File
@@ -10,8 +10,7 @@ const apptask = require('../apptask.js'),
expect = require('expect.js'),
fs = require('fs'),
paths = require('../paths.js'),
safe = require('safetydance'),
_ = require('underscore');
safe = require('safetydance');
describe('apptask', function () {
const { setup, cleanup, app } = common;
@@ -37,7 +36,7 @@ describe('apptask', function () {
});
it('barfs on empty manifest', async function () {
const badApp = _.extend({ }, app);
const badApp = Object.assign({ }, app);
badApp.manifest = { };
const [error] = await safe(apptask._verifyManifest(badApp.manifest));
@@ -45,8 +44,8 @@ describe('apptask', function () {
});
it('fails on bad manifest', async function () {
const badApp = _.extend({ }, app);
badApp.manifest = _.extend({ }, app.manifest);
const badApp = Object.assign({ }, app);
badApp.manifest = Object.assign({ }, app.manifest);
delete badApp.manifest.httpPort;
const [error] = await safe(apptask._verifyManifest(badApp.manifest));
@@ -54,8 +53,8 @@ describe('apptask', function () {
});
it('barfs on incompatible manifest', async function () {
const badApp = _.extend({ }, app);
badApp.manifest = _.extend({ }, app.manifest);
const badApp = Object.assign({ }, app);
badApp.manifest = Object.assign({ }, app.manifest);
badApp.manifest.maxBoxVersion = '0.0.0'; // max box version is too small
const [error] = await safe(apptask._verifyManifest(badApp.manifest));
@@ -63,7 +62,7 @@ describe('apptask', function () {
});
it('verifies manifest', async function () {
const goodApp = _.extend({ }, app);
const goodApp = Object.assign({ }, app);
await apptask._verifyManifest(goodApp.manifest);
});