1 | import type { Services, Options } from '@wdio/types';
|
2 | import type { MochaOpts as MochaOptsImport, FrameworkMessage, MochaError } from './types.js';
|
3 | import type { EventEmitter } from 'node:events';
|
4 | type EventTypes = 'hook' | 'test' | 'suite';
|
5 | interface ParsedConfiguration extends Required<Options.Testrunner> {
|
6 | rootDir: string;
|
7 | mochaOpts: MochaOptsImport;
|
8 | }
|
9 |
|
10 |
|
11 |
|
12 | declare class MochaAdapter {
|
13 | private _cid;
|
14 | private _config;
|
15 | private _specs;
|
16 | private _capabilities;
|
17 | private _reporter;
|
18 | private _mocha?;
|
19 | private _runner?;
|
20 | private _specLoadError?;
|
21 | private _level;
|
22 | private _hasTests;
|
23 | private _suiteIds;
|
24 | private _suiteCnt;
|
25 | private _hookCnt;
|
26 | private _testCnt;
|
27 | private _suiteStartDate;
|
28 | constructor(_cid: string, _config: ParsedConfiguration, _specs: string[], _capabilities: WebdriverIO.Capabilities, _reporter: EventEmitter);
|
29 | init(): Promise<this>;
|
30 | _loadFiles(mochaOpts: MochaOptsImport): Promise<void>;
|
31 | hasTests(): boolean;
|
32 | run(): Promise<unknown>;
|
33 | /**
|
34 | * Hooks which are added as true Mocha hooks need to call done() to notify async
|
35 | */
|
36 | wrapHook(hookName: keyof Services.HookFunctions): () => Promise<void | unknown[]>;
|
37 | prepareMessage(hookName: keyof Services.HookFunctions): import("./types.js").FormattedMessage;
|
38 | emit(event: string, payload: Record<string, unknown>, err?: MochaError): void;
|
39 | getSyncEventIdStart(type: EventTypes): string;
|
40 | getSyncEventIdEnd(type: EventTypes): string;
|
41 | getUID(message: FrameworkMessage): string;
|
42 | }
|
43 | declare const adapterFactory: {
|
44 | init?: Function;
|
45 | };
|
46 | export default adapterFactory;
|
47 | export { MochaAdapter, adapterFactory };
|
48 | export * from './types.js';
|
49 | declare global {
|
50 | namespace WebdriverIO {
|
51 | interface MochaOpts extends MochaOptsImport {
|
52 | }
|
53 | }
|
54 | }
|
55 |
|
\ | No newline at end of file |