mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
parent
a67a0b677c
commit
95ec3096e0
@ -50,6 +50,7 @@ _This release is scheduled to be released on 2023-10-01._
|
|||||||
- Respect width/height (no fullscreen) if set in electronOptions (together with `fullscreen: false`) in `config.js` (#3174)
|
- Respect width/height (no fullscreen) if set in electronOptions (together with `fullscreen: false`) in `config.js` (#3174)
|
||||||
- Fix: AnimateCSS merge hide() and show() animated css class when we do multiple call
|
- Fix: AnimateCSS merge hide() and show() animated css class when we do multiple call
|
||||||
- Fix `Uncaught SyntaxError: Identifier 'getCorsUrl' has already been declared (at utils.js:1:1)` when using `clock` and `weather` module (#3204)
|
- Fix `Uncaught SyntaxError: Identifier 'getCorsUrl' has already been declared (at utils.js:1:1)` when using `clock` and `weather` module (#3204)
|
||||||
|
- Fix overriding `config.js` when running tests (#3201)
|
||||||
|
|
||||||
## [2.24.0] - 2023-07-01
|
## [2.24.0] - 2023-07-01
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@ exports.getText = async (element, result) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
exports.startApp = async (configFileName, additionalMockData) => {
|
exports.startApp = async (configFileName, additionalMockData) => {
|
||||||
injectMockData(configFileName, additionalMockData);
|
await helpers.startApplication(injectMockData(configFileName, additionalMockData));
|
||||||
await helpers.startApplication("");
|
|
||||||
await helpers.getDocument();
|
await helpers.getDocument();
|
||||||
};
|
};
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
const helpers = require("../helpers/global-setup");
|
const helpers = require("../helpers/global-setup");
|
||||||
const weatherFunc = require("../helpers/weather-functions");
|
const weatherFunc = require("../helpers/weather-functions");
|
||||||
|
const { cleanupMockData } = require("../../utils/weather_mocker");
|
||||||
|
|
||||||
describe("Weather module", () => {
|
describe("Weather module", () => {
|
||||||
afterAll(async () => {
|
afterAll(async () => {
|
||||||
await helpers.stopApplication();
|
await helpers.stopApplication();
|
||||||
|
await cleanupMockData();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("Current weather", () => {
|
describe("Current weather", () => {
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
const helpers = require("../helpers/global-setup");
|
const helpers = require("../helpers/global-setup");
|
||||||
const weatherFunc = require("../helpers/weather-functions");
|
const weatherFunc = require("../helpers/weather-functions");
|
||||||
|
const { cleanupMockData } = require("../../utils/weather_mocker");
|
||||||
|
|
||||||
describe("Weather module: Weather Forecast", () => {
|
describe("Weather module: Weather Forecast", () => {
|
||||||
afterAll(async () => {
|
afterAll(async () => {
|
||||||
await helpers.stopApplication();
|
await helpers.stopApplication();
|
||||||
|
await cleanupMockData();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("Default configuration", () => {
|
describe("Default configuration", () => {
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
const helpers = require("../helpers/global-setup");
|
const helpers = require("../helpers/global-setup");
|
||||||
const weatherFunc = require("../helpers/weather-functions");
|
const weatherFunc = require("../helpers/weather-functions");
|
||||||
|
const { cleanupMockData } = require("../../utils/weather_mocker");
|
||||||
|
|
||||||
describe("Weather module: Weather Hourly Forecast", () => {
|
describe("Weather module: Weather Hourly Forecast", () => {
|
||||||
afterAll(async () => {
|
afterAll(async () => {
|
||||||
await helpers.stopApplication();
|
await helpers.stopApplication();
|
||||||
|
await cleanupMockData();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("Default configuration", () => {
|
describe("Default configuration", () => {
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
const fs = require("fs");
|
||||||
const helpers = require("./helpers/global-setup");
|
const helpers = require("./helpers/global-setup");
|
||||||
|
|
||||||
describe("templated config with port variable", () => {
|
describe("templated config with port variable", () => {
|
||||||
@ -6,6 +7,11 @@ describe("templated config with port variable", () => {
|
|||||||
});
|
});
|
||||||
afterAll(async () => {
|
afterAll(async () => {
|
||||||
await helpers.stopApplication();
|
await helpers.stopApplication();
|
||||||
|
try {
|
||||||
|
fs.unlinkSync("tests/configs/port_variable.js");
|
||||||
|
} catch (err) {
|
||||||
|
// do nothing
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should return 200", async () => {
|
it("should return 200", async () => {
|
||||||
|
@ -13,7 +13,6 @@ exports.getText = async (element, result) => {
|
|||||||
).toBe(result);
|
).toBe(result);
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.startApp = async (configFileNameName, systemDate) => {
|
exports.startApp = async (configFileName, systemDate) => {
|
||||||
injectMockData(configFileNameName);
|
await helpers.startApplication(injectMockData(configFileName), systemDate);
|
||||||
await helpers.startApplication("", systemDate);
|
|
||||||
};
|
};
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
const helpers = require("../helpers/global-setup");
|
const helpers = require("../helpers/global-setup");
|
||||||
const weatherHelper = require("../helpers/weather-setup");
|
const weatherHelper = require("../helpers/weather-setup");
|
||||||
|
const { cleanupMockData } = require("../../utils/weather_mocker");
|
||||||
|
|
||||||
describe("Weather module", () => {
|
describe("Weather module", () => {
|
||||||
afterEach(async () => {
|
afterEach(async () => {
|
||||||
await helpers.stopApplication();
|
await helpers.stopApplication();
|
||||||
|
await cleanupMockData();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("Current weather with sunrise", () => {
|
describe("Current weather with sunrise", () => {
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
|
const util = require("util");
|
||||||
|
const exec = util.promisify(require("child_process").exec);
|
||||||
const _ = require("lodash");
|
const _ = require("lodash");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -35,9 +37,16 @@ const injectMockData = (configFileName, extendedData = {}) => {
|
|||||||
} else {
|
} else {
|
||||||
mockWeather = readMockData("current", extendedData);
|
mockWeather = readMockData("current", extendedData);
|
||||||
}
|
}
|
||||||
let content = fs.readFileSync(path.resolve(`${__dirname}../../../${configFileName}`)).toString();
|
let content = fs.readFileSync(configFileName).toString();
|
||||||
content = content.replace("#####WEATHERDATA#####", mockWeather);
|
content = content.replace("#####WEATHERDATA#####", mockWeather);
|
||||||
fs.writeFileSync(path.resolve(`${__dirname}../../../config/config.js`), content);
|
const tempFile = configFileName.replace(".js", "_temp.js");
|
||||||
|
fs.writeFileSync(tempFile, content);
|
||||||
|
return tempFile;
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = { injectMockData };
|
const cleanupMockData = async () => {
|
||||||
|
const tempDir = path.resolve(`${__dirname}/../configs`).toString();
|
||||||
|
await exec(`find ${tempDir} -type f -name *_temp.js -delete`);
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = { injectMockData, cleanupMockData };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user