Move more element-web tests over to vitest (#33845)
* Move more element-web tests over to vitest Switches default env to happy-dom as SdkConfig needs a DOM and is part of the setupTests given a lot of code relies on it * Restore jest variant of editor mock file for tests not yet moved over * Migrate batch of tests tro vitest * Iterate * Migrate another test * Simplify * Iterate * Iterate * Fix lockfile * Deduplicate * Iterate
This commit is contained in:
@@ -13,6 +13,7 @@ import type AutocompleteWrapperModel from "../../../src/editor/autocomplete";
|
||||
import { type Caret } from "../../../src/editor/caret";
|
||||
import { type PillPart, type Part, PartCreator } from "../../../src/editor/parts";
|
||||
import DocumentPosition from "../../../src/editor/position";
|
||||
import { vi } from "../../setup/adapter.ts";
|
||||
|
||||
export class MockAutoComplete {
|
||||
public _updateCallback;
|
||||
@@ -68,8 +69,8 @@ export function createPartCreator(completions: PillPart[] = []) {
|
||||
};
|
||||
const room = new MockRoom() as unknown as Room;
|
||||
const client = {
|
||||
getRooms: jest.fn().mockReturnValue([]),
|
||||
getRoom: jest.fn().mockReturnValue(null),
|
||||
getRooms: vi.fn().mockReturnValue([]),
|
||||
getRoom: vi.fn().mockReturnValue(null),
|
||||
} as unknown as MatrixClient;
|
||||
return new PartCreator(room, client, autoCompleteCreator);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user