replace console with Log in calendar debug.js (#3846)

to avoid exception in eslint config.

Background: If someone has a copy of the `modules` folder in his setup
eslint fails because the file `debug.js` uses `console` statements. I
need the `modules` folder renamed in my docker setup so this test always
fails. I think this is a simple solution which has no impact.
This commit is contained in:
Karsten Hassel 2025-07-16 00:38:03 +02:00 committed by GitHub
parent 02e76da196
commit 54752f10e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 7 deletions

View File

@ -20,6 +20,7 @@ Thanks to: @dathbe.
- [refactor] Add new file `js/module_functions.js` to move code used in several modules to one place (#3837) - [refactor] Add new file `js/module_functions.js` to move code used in several modules to one place (#3837)
- [tests] refactor: simplify jest config file (#3844) - [tests] refactor: simplify jest config file (#3844)
- [tests] refactor: extract constants for weather electron tests (#3845) - [tests] refactor: extract constants for weather electron tests (#3845)
- [tests] replace `console` with `Log` in calendar `debug.js` to avoid exception in eslint config (#3846)
### Updated ### Updated

View File

@ -88,7 +88,6 @@ export default defineConfig([
files: ["**/*.js"], files: ["**/*.js"],
ignores: [ ignores: [
"clientonly/index.js", "clientonly/index.js",
"modules/default/calendar/debug.js",
"js/logger.js", "js/logger.js",
"tests/**/*.js" "tests/**/*.js"
], ],

View File

@ -5,6 +5,7 @@
*/ */
// Alias modules mentioned in package.js under _moduleAliases. // Alias modules mentioned in package.js under _moduleAliases.
require("module-alias/register"); require("module-alias/register");
const Log = require("../../../js/logger");
const CalendarFetcher = require("./calendarfetcher"); const CalendarFetcher = require("./calendarfetcher");
@ -20,22 +21,22 @@ const auth = {
pass: pass pass: pass
}; };
console.log("Create fetcher ..."); Log.log("Create fetcher ...");
const fetcher = new CalendarFetcher(url, fetchInterval, [], maximumEntries, maximumNumberOfDays, auth); const fetcher = new CalendarFetcher(url, fetchInterval, [], maximumEntries, maximumNumberOfDays, auth);
fetcher.onReceive(function (fetcher) { fetcher.onReceive(function (fetcher) {
console.log(fetcher.events()); Log.log(fetcher.events());
console.log("------------------------------------------------------------"); Log.log("------------------------------------------------------------");
process.exit(0); process.exit(0);
}); });
fetcher.onError(function (fetcher, error) { fetcher.onError(function (fetcher, error) {
console.log("Fetcher error:"); Log.log("Fetcher error:");
console.log(error); Log.log(error);
process.exit(1); process.exit(1);
}); });
fetcher.startFetch(); fetcher.startFetch();
console.log("Create fetcher done! "); Log.log("Create fetcher done! ");