Optimise Jest run in CI (#9542)
This commit is contained in:
parent
28ecdc0cb4
commit
04bc8fb71c
55 changed files with 1388 additions and 1305 deletions
|
@ -72,12 +72,14 @@ function stringToArray(s: string): ArrayBufferLike {
|
|||
describe('MegolmExportEncryption', function() {
|
||||
let MegolmExportEncryption;
|
||||
|
||||
beforeAll(() => {
|
||||
beforeEach(() => {
|
||||
window.crypto = {
|
||||
subtle: webCrypto.subtle,
|
||||
getRandomValues,
|
||||
randomUUID: jest.fn().mockReturnValue("not-random-uuid"),
|
||||
subtle: webCrypto.subtle,
|
||||
};
|
||||
// @ts-ignore for some reason including it in the object above gets ignored
|
||||
window.crypto.subtle = webCrypto.subtle;
|
||||
MegolmExportEncryption = require("../../src/utils/MegolmExportEncryption");
|
||||
});
|
||||
|
||||
|
@ -142,8 +144,7 @@ cissyYBxjsfsAn
|
|||
|
||||
describe('encrypt', function() {
|
||||
it('should round-trip', function() {
|
||||
const input =
|
||||
'words words many words in plain text here'.repeat(100);
|
||||
const input = 'words words many words in plain text here'.repeat(100);
|
||||
|
||||
const password = 'my super secret passphrase';
|
||||
|
||||
|
|
|
@ -1,32 +1,32 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`createVoiceMessageContent should create a voice message content 1`] = `
|
||||
Object {
|
||||
{
|
||||
"body": "Voice message",
|
||||
"file": Object {},
|
||||
"info": Object {
|
||||
"file": {},
|
||||
"info": {
|
||||
"duration": 23000,
|
||||
"mimetype": "ogg/opus",
|
||||
"size": 42000,
|
||||
},
|
||||
"msgtype": "m.audio",
|
||||
"org.matrix.msc1767.audio": Object {
|
||||
"org.matrix.msc1767.audio": {
|
||||
"duration": 23000,
|
||||
"waveform": Array [
|
||||
"waveform": [
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
],
|
||||
},
|
||||
"org.matrix.msc1767.file": Object {
|
||||
"file": Object {},
|
||||
"org.matrix.msc1767.file": {
|
||||
"file": {},
|
||||
"mimetype": "ogg/opus",
|
||||
"name": "Voice message.ogg",
|
||||
"size": 42000,
|
||||
"url": "mxc://example.com/file",
|
||||
},
|
||||
"org.matrix.msc1767.text": "Voice message",
|
||||
"org.matrix.msc3245.voice": Object {},
|
||||
"org.matrix.msc3245.voice": {},
|
||||
"url": "mxc://example.com/file",
|
||||
}
|
||||
`;
|
||||
|
|
|
@ -23,7 +23,7 @@ import HTMLExporter from "../../../src/utils/exportUtils/HtmlExport";
|
|||
|
||||
describe("HTMLExport", () => {
|
||||
beforeEach(() => {
|
||||
jest.useFakeTimers('modern');
|
||||
jest.useFakeTimers();
|
||||
jest.setSystemTime(REPEATABLE_DATE);
|
||||
});
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ import { ExportType, IExportOptions } from "../../../src/utils/exportUtils/expor
|
|||
|
||||
describe("JSONExport", () => {
|
||||
beforeEach(() => {
|
||||
jest.useFakeTimers('modern');
|
||||
jest.useFakeTimers();
|
||||
jest.setSystemTime(REPEATABLE_DATE);
|
||||
});
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ import PlainTextExporter from "../../../src/utils/exportUtils/PlainTextExport";
|
|||
|
||||
describe("PlainTextExport", () => {
|
||||
beforeEach(() => {
|
||||
jest.useFakeTimers('modern');
|
||||
jest.useFakeTimers();
|
||||
jest.setSystemTime(REPEATABLE_DATE);
|
||||
});
|
||||
|
||||
|
|
|
@ -67,11 +67,9 @@ describe('notifications', () => {
|
|||
it.each(deviceNotificationSettingsKeys)(
|
||||
'unsilenced for existing sessions when %s setting is truthy',
|
||||
async (settingKey) => {
|
||||
mocked(SettingsStore)
|
||||
.getValue
|
||||
.mockImplementation((key) => {
|
||||
return key === settingKey;
|
||||
});
|
||||
mocked(SettingsStore).getValue.mockImplementation((key): any => {
|
||||
return key === settingKey;
|
||||
});
|
||||
|
||||
await createLocalNotificationSettingsIfNeeded(mockClient);
|
||||
const event = mockClient.getAccountData(accountDataEventKey);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue