mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-19 16:08:34 +01:00
Add unsupported/sse message export/import
This commit is contained in:
@@ -5,9 +5,12 @@
|
||||
|
||||
import { ipcRenderer as ipc } from 'electron';
|
||||
import { sync } from 'fast-glob';
|
||||
import { inspect } from 'util';
|
||||
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import { assert } from 'chai';
|
||||
import { assert, config as chaiConfig } from 'chai';
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import { reporters } from 'mocha';
|
||||
|
||||
import { getSignalProtocolStore } from '../../SignalProtocolStore';
|
||||
import { initMessageCleanup } from '../../services/messageStateCleanup';
|
||||
@@ -16,6 +19,28 @@ import { initializeRedux } from '../../state/initializeRedux';
|
||||
import * as Stickers from '../../types/Stickers';
|
||||
import { ThemeType } from '../../types/Util';
|
||||
|
||||
// Show actual objects instead of abbreviated errors
|
||||
chaiConfig.truncateThreshold = 0;
|
||||
|
||||
function patchDeepEqual(method: 'deepEqual' | 'deepStrictEqual'): void {
|
||||
const originalFn = assert[method];
|
||||
assert[method] = (...args) => {
|
||||
try {
|
||||
return originalFn(...args);
|
||||
} catch (error) {
|
||||
reporters.base.useColors = false;
|
||||
error.message = reporters.base.generateDiff(
|
||||
inspect(error.actual, { depth: Infinity, sorted: true }),
|
||||
inspect(error.expected, { depth: Infinity, sorted: true })
|
||||
);
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
patchDeepEqual('deepEqual');
|
||||
patchDeepEqual('deepStrictEqual');
|
||||
|
||||
window.assert = assert;
|
||||
|
||||
// This is a hack to let us run TypeScript tests in the renderer process. See the
|
||||
|
||||
Reference in New Issue
Block a user