mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-22 13:09:26 +00:00
improve tests (#2923)
use es6 syntax in all tests, split weather tests, remove callbacks
This commit is contained in:
@@ -3,13 +3,13 @@
|
||||
*
|
||||
* @param {string} err The error message.
|
||||
*/
|
||||
function mockError(err) {
|
||||
const mockError = (err) => {
|
||||
if (err.includes("ECONNREFUSED") || err.includes("ECONNRESET") || err.includes("socket hang up") || err.includes("exports is not defined") || err.includes("write EPIPE")) {
|
||||
jest.fn();
|
||||
} else {
|
||||
console.dir(err);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
global.console = {
|
||||
log: jest.fn(),
|
||||
|
Reference in New Issue
Block a user