Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correctly specify types for "mochaOpts" and "patternsOnReject" #1033

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

DudaGod
Copy link
Member

@DudaGod DudaGod commented Nov 27, 2024

No description provided.

}

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.

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

/** string or regexp to filter tests with. */
grep?: string | RegExp;
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

@DudaGod DudaGod merged commit 87b7351 into master Nov 27, 2024
2 checks passed
@DudaGod DudaGod deleted the TESTPLANE-351.fix_types branch November 27, 2024 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants