Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mock-console.js 471B

123456789101112131415161718192021
  1. /**
  2. * Suppresses errors concerning web server already shut down.
  3. *
  4. * @param {string} err The error message.
  5. */
  6. function mockError(err) {
  7. if (err.includes("ECONNREFUSED") || err.includes("ECONNRESET") || err.includes("socket hang up") || err.includes("exports is not defined")) {
  8. jest.fn();
  9. } else {
  10. console.dir(err);
  11. }
  12. }
  13. global.console = {
  14. log: jest.fn(),
  15. dir: console.dir,
  16. error: mockError,
  17. warn: console.warn,
  18. info: jest.fn(),
  19. debug: console.debug
  20. };