-
Notifications
You must be signed in to change notification settings - Fork 63
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
Conversation
} | ||
|
||
export interface SystemConfig { | ||
debug: boolean; | ||
mochaOpts: MochaOpts; | ||
expectOpts: ExpectOptsConfig; | ||
ctx: { [name: string]: unknown }; | ||
patternsOnReject: Array<string>; | ||
patternsOnReject: Array<string | RegExp>; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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
747083a
to
6cfb9e1
Compare
No description provided.