-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Improve e2e testing docs and add cli args. #14717
Changes from 1 commit
00e5cc6
72be60e
3155ed2
3264678
6784492
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,4 +50,16 @@ if ( hasCliArg( '--puppeteer-interactive' ) ) { | |
process.env.PUPPETEER_SLOWMO = getCliArg( '--puppeteer-slowmo' ) || 80; | ||
} | ||
|
||
const configsMapping = { | ||
WP_BASE_URL: "--wordpress-host", | ||
WP_USERNAME: "--wordpress-username", | ||
WP_PASSWORD: "--wordpress-password" | ||
}; | ||
|
||
Object.entries(configsMapping).forEach(([key, value]) => { | ||
if (hasCliArg(value)) { | ||
process.env[key] = getCliArg(value); | ||
} | ||
}); | ||
|
||
jest.run( [ ...config, ...runInBand, ...getCliArgs( cleanUpPrefixes ) ] ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. const cleanUpPrefixes = [ '--puppeteer-' ]; At the moment That's why @draganescu added logic which allows to filter out CLI args starting with a given pattern. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Didn't knew that, had adjusted, thx. |
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.
Is this readable enough on first glance?
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.
Yes, it looks good. You can use more specific names instead key and name, e.g. envKey and argName or something like that.
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.
Adjusted, thx.