You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-08-06 10:22:45 +03:00
Prevent flaky Jest test by pre-loading WASM (#11975)
Fixes https://github.com/vector-im/element-web/issues/26650
This commit is contained in:
@@ -15,7 +15,7 @@ limitations under the License.
|
|||||||
*/
|
*/
|
||||||
import { MsgType } from "matrix-js-sdk/src/matrix";
|
import { MsgType } from "matrix-js-sdk/src/matrix";
|
||||||
|
|
||||||
import { mkEvent } from "../../../../../test-utils";
|
import { filterConsole, mkEvent } from "../../../../../test-utils";
|
||||||
import { RoomPermalinkCreator } from "../../../../../../src/utils/permalinks/Permalinks";
|
import { RoomPermalinkCreator } from "../../../../../../src/utils/permalinks/Permalinks";
|
||||||
import {
|
import {
|
||||||
createMessageContent,
|
createMessageContent,
|
||||||
@@ -42,6 +42,17 @@ describe("createMessageContent", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("Richtext composer input", () => {
|
describe("Richtext composer input", () => {
|
||||||
|
filterConsole(
|
||||||
|
"WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm`",
|
||||||
|
);
|
||||||
|
|
||||||
|
beforeAll(async () => {
|
||||||
|
// Warm up by creating the component once, with a long timeout.
|
||||||
|
// This prevents tests timing out because of the time spent loading
|
||||||
|
// the WASM component.
|
||||||
|
await createMessageContent(message, true, { permalinkCreator });
|
||||||
|
}, 10000);
|
||||||
|
|
||||||
it("Should create html message", async () => {
|
it("Should create html message", async () => {
|
||||||
// When
|
// When
|
||||||
const content = await createMessageContent(message, true, { permalinkCreator });
|
const content = await createMessageContent(message, true, { permalinkCreator });
|
||||||
|
Reference in New Issue
Block a user