mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +00:00
e2e: - needed window.close(), otherwise the objects are not destroyed - add missing `await` in clock test - set maxListeners for all tests remaining todo (comes with another PR if I find the problem): - calendar e2e is now the only test which still needs `--forceExit`
32 lines
675 B
JavaScript
32 lines
675 B
JavaScript
/**
|
|
* Suppresses errors concerning web server already shut down.
|
|
* @param {string} err The error message.
|
|
*/
|
|
const mockError = (err) => {
|
|
if (
|
|
err.includes("ECONNREFUSED")
|
|
|| err.includes("ECONNRESET")
|
|
|| err.includes("socket hang up")
|
|
|| err.includes("exports is not defined")
|
|
|| err.includes("module is not defined")
|
|
|| err.includes("write EPIPE")
|
|
|| err.includes("AggregateError")
|
|
|| err.includes("ERR_SOCKET_CONNECTION_TIMEOUT")
|
|
) {
|
|
jest.fn();
|
|
} else {
|
|
console.dir(err);
|
|
}
|
|
};
|
|
|
|
global.console = {
|
|
log: jest.fn(),
|
|
dir: console.dir,
|
|
error: mockError,
|
|
warn: console.warn,
|
|
info: jest.fn(),
|
|
debug: console.debug
|
|
};
|
|
|
|
process.setMaxListeners(0);
|