1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-01-11 18:24:43 +02:00
joplin/packages/app-desktop/jest.setup.js

28 lines
671 B
JavaScript
Raw Normal View History

2023-07-28 11:46:40 +02:00
const { default: Logger, TargetType } = require('@joplin/utils/Logger');
2023-08-04 11:57:54 +02:00
const initLib = require('@joplin/lib/initLib').default;
// TODO: Some libraries required by test-utils.js seem to fail to import with the
// jsdom environment.
//
// Thus, require('@joplin/lib/testing/test-utils.js') fails and some setup must be
// copied.
const logger = new Logger();
logger.addTarget(TargetType.Console);
logger.setLevel(Logger.LEVEL_WARN);
Logger.initializeGlobalLogger(logger);
2023-08-04 11:57:54 +02:00
initLib(logger);
// @electron/remote requires electron to be running. Mock it.
jest.mock('@electron/remote', () => {
2023-08-04 11:57:54 +02:00
return {
require: () => {
return {
default: {},
};
},
};
});