-
Notifications
You must be signed in to change notification settings - Fork 141
/
test-setup.ts
45 lines (42 loc) · 1.17 KB
/
test-setup.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { vi } from "vitest";
// We mock the environment variable because jest is not able to load import.meta.env
vi.mock("./src/environment.ts", () => ({
BASE_URL: "/",
FETCH_ROOT_KEY: false,
DUMMY_AUTH: false,
DUMMY_CAPTCHA: false,
VERSION: ",,clean",
}));
export type WebAuthnCredential = {
credentialId: string;
isResidentCredential: boolean;
privateKey: string;
signCount: number;
};
declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace WebdriverIO {
interface Browser {
addVirtualWebAuth: (
protocol: string,
transport: string,
hasResidentKey: boolean,
isUserConsenting: boolean
) => Promise<string>;
removeVirtualWebAuth: (authenticatorId: string) => Promise<void>;
getWebauthnCredentials: (
authenticatorId: string
) => Promise<WebAuthnCredential[]>;
addWebauthnCredential: (
authenticatorId: string,
rpId: string,
credentialId: string,
isResidentCredential: boolean,
privateKey: string,
signCount: number,
userHandle?: string,
largeBlob?: string
) => Promise<void>;
}
}
}