signal-desktop/test/setup-test-node.js

25 lines
581 B
JavaScript
Raw Normal View History

// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
/* eslint-disable no-console */
const { setEnvironment, Environment } = require('../ts/environment');
before(() => {
setEnvironment(Environment.Test);
});
// To replicate logic we have on the client side
global.window = {
log: {
info: (...args) => console.log(...args),
warn: (...args) => console.warn(...args),
error: (...args) => console.error(...args),
},
i18n: key => `i18n(${key})`,
};
// For ducks/network.getEmptyState()
global.navigator = {};
global.WebSocket = {};