diff --git a/CHANGELOG.md b/CHANGELOG.md index 1325372660..ca3df69f3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,8 @@ _This release is scheduled to be released on 2024-04-01._ ### Updated -- Use node prefix for build-in modules +- Removing lodash dependency by replacing merge by spread operator (#3339) +- Use node prefix for build-in modules (#3340) ### Fixed diff --git a/package-lock.json b/package-lock.json index 11fabf91f0..986e535a5a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,7 +38,6 @@ "jest": "^29.7.0", "jsdom": "^23.0.1", "lint-staged": "^15.2.0", - "lodash": "^4.17.21", "playwright": "^1.40.1", "prettier": "^3.1.1", "sinon": "^17.0.1", diff --git a/package.json b/package.json index 578e4a740a..6ecce674bc 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,6 @@ "jest": "^29.7.0", "jsdom": "^23.0.1", "lint-staged": "^15.2.0", - "lodash": "^4.17.21", "playwright": "^1.40.1", "prettier": "^3.1.1", "sinon": "^17.0.1", diff --git a/tests/utils/weather_mocker.js b/tests/utils/weather_mocker.js index 4354df1d10..70d56e6812 100644 --- a/tests/utils/weather_mocker.js +++ b/tests/utils/weather_mocker.js @@ -2,7 +2,6 @@ const fs = require("node:fs"); const path = require("node:path"); const util = require("node:util"); const exec = util.promisify(require("node:child_process").exec); -const _ = require("lodash"); /** * @param {string} type what data to read, can be "current" "forecast" or "hourly @@ -25,7 +24,9 @@ const readMockData = (type, extendedData = {}) => { break; } - return JSON.stringify(_.merge({}, JSON.parse(fs.readFileSync(path.resolve(`${__dirname}/../mocks/${fileName}`)).toString()), extendedData)); + const fileData = JSON.parse(fs.readFileSync(path.resolve(`${__dirname}/../mocks/${fileName}`)).toString()); + const mergedData = JSON.stringify({ ...{}, ...fileData, ...extendedData }); + return mergedData; }; const injectMockData = (configFileName, extendedData = {}) => {