Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions src/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,23 +128,16 @@ export interface ExpectOptsConfig {
interval: number;
}

export interface MochaOpts {
/** milliseconds to wait before considering a test slow. */
slow?: number;

/** timeout in milliseconds or time string like '1s'. */
timeout?: number;

/** string or regexp to filter tests with. */
grep?: string | RegExp;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these options specified inside Mocha.MochaOptions, so I just use it. Moreover it has a lot of other options that user can use.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

export interface MochaOpts extends Omit<Mocha.MochaOptions, "ui"> {
ui?: string | ((suite: Mocha.Suite) => void);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently ui field inside mocha specified incorrectly. It says that I can use only: bdd, tdd and other prepared interfaces. But actually I can specify just a string to the file which will be required by mocha or use function

}

export interface SystemConfig {
debug: boolean;
mochaOpts: MochaOpts;
expectOpts: ExpectOptsConfig;
ctx: { [name: string]: unknown };
patternsOnReject: Array<string>;
patternsOnReject: Array<string | RegExp>;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be specified as RegExp. Like this:

patternsOnReject: [/foo/i, /bar/, /baz/g]

Under the hood we wrap all items from patternsOnReject to RegExp. Like this - new RegExp(pattern). So it works correctly if user specify regexp value.

workers: number;
testsPerWorker: number;
diffColor: string;
Expand Down