mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-24 05:58:08 +00:00
Use node prefix for build-in modules (#3340)
It is basically a cosmetic thing, but has the following advantages: 1. Consistency with the official node documentation. The prefix is used there. 2. It is easier to recognize the build-in modules.
This commit is contained in:
committed by
GitHub
parent
407072d12d
commit
4bbd35fa6a
@@ -3,7 +3,7 @@ const helpers = require("./helpers/global-setup");
|
||||
describe("All font files from roboto.css should be downloadable", () => {
|
||||
const fontFiles = [];
|
||||
// Statements below filters out all 'url' lines in the CSS file
|
||||
const fileContent = require("fs").readFileSync(`${__dirname}/../../fonts/roboto.css`, "utf8");
|
||||
const fileContent = require("node:fs").readFileSync(`${__dirname}/../../fonts/roboto.css`, "utf8");
|
||||
const regex = /\burl\(['"]([^'"]+)['"]\)/g;
|
||||
let match = regex.exec(fileContent);
|
||||
while (match !== null) {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
const path = require("path");
|
||||
const path = require("node:path");
|
||||
const auth = require("express-basic-auth");
|
||||
const express = require("express");
|
||||
|
||||
|
@@ -6,7 +6,7 @@ describe("App environment", () => {
|
||||
let serverProcess;
|
||||
beforeAll(async () => {
|
||||
process.env.MM_CONFIG_FILE = "tests/configs/default.js";
|
||||
serverProcess = await require("child_process").spawn("npm", ["run", "server"], { env: process.env, detached: true });
|
||||
serverProcess = await require("node:child_process").spawn("npm", ["run", "server"], { env: process.env, detached: true });
|
||||
// we have to wait until the server is startet
|
||||
await delay(2000);
|
||||
});
|
||||
|
@@ -1,4 +1,4 @@
|
||||
const fs = require("fs");
|
||||
const fs = require("node:fs");
|
||||
const helpers = require("./helpers/global-setup");
|
||||
|
||||
describe("templated config with port variable", () => {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const fs = require("node:fs");
|
||||
const path = require("node:path");
|
||||
const helmet = require("helmet");
|
||||
const { JSDOM } = require("jsdom");
|
||||
const express = require("express");
|
||||
|
@@ -1,4 +1,4 @@
|
||||
const events = require("events");
|
||||
const events = require("node:events");
|
||||
const helpers = require("./helpers/global-setup");
|
||||
|
||||
describe("Electron app environment", () => {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
const path = require("path");
|
||||
const path = require("node:path");
|
||||
const { JSDOM } = require("jsdom");
|
||||
|
||||
describe("File js/class", () => {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
const path = require("path");
|
||||
const path = require("node:path");
|
||||
const helmet = require("helmet");
|
||||
const { JSDOM } = require("jsdom");
|
||||
const express = require("express");
|
||||
|
@@ -1,4 +1,4 @@
|
||||
const path = require("path");
|
||||
const path = require("node:path");
|
||||
const { JSDOM } = require("jsdom");
|
||||
|
||||
describe("Test function cmpVersions in js/module.js", () => {
|
||||
|
@@ -1,9 +1,9 @@
|
||||
jest.mock("util", () => ({
|
||||
jest.mock("node:util", () => ({
|
||||
...jest.requireActual("util"),
|
||||
promisify: jest.fn()
|
||||
}));
|
||||
|
||||
jest.mock("fs", () => ({
|
||||
jest.mock("node:fs", () => ({
|
||||
...jest.requireActual("fs"),
|
||||
statSync: jest.fn()
|
||||
}));
|
||||
@@ -29,7 +29,7 @@ describe("Updatenotification", () => {
|
||||
let gitTagListOut;
|
||||
|
||||
beforeAll(async () => {
|
||||
const { promisify } = require("util");
|
||||
const { promisify } = require("node:util");
|
||||
promisify.mockReturnValue(execMock);
|
||||
|
||||
const GitHelper = require("../../../modules/default/updatenotification/git_helper");
|
||||
|
@@ -1,5 +1,5 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const fs = require("node:fs");
|
||||
const path = require("node:path");
|
||||
|
||||
const root_path = path.join(__dirname, "../../..");
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const fs = require("node:fs");
|
||||
const path = require("node:path");
|
||||
|
||||
const root_path = path.join(__dirname, "../../..");
|
||||
const version = require(`${__dirname}/../../../package.json`).version;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const util = require("util");
|
||||
const exec = util.promisify(require("child_process").exec);
|
||||
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");
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user