Prevent flaky Jest test by pre-loading WASM (#11975)

Fixes https://github.com/vector-im/element-web/issues/26650
t3chguy/dedup-icons-17oct
Andy Balaam 2023-11-29 10:11:53 +00:00 committed by GitHub
parent 11695d3227
commit c5377bc228
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 1 deletions

View File

@ -15,7 +15,7 @@ limitations under the License.
*/
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 {
createMessageContent,
@ -42,6 +42,17 @@ describe("createMessageContent", () => {
});
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 () => {
// When
const content = await createMessageContent(message, true, { permalinkCreator });