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

Helper baseclass sets this.opts in setConfig, not this.config? #5

Open
tfh-cri opened this issue Dec 3, 2023 · 1 comment
Open

Comments

@tfh-cri
Copy link

tfh-cri commented Dec 3, 2023

I was trying to work out why the documented details around Scenario(...).config('SomeHelper', {...}) weren't working for me, and as
far as I can tell, the default base class implementation of _setConfig is actually setting this.opts rather than this.config (which I presume is the correct version, since it's mentioned both in the docs and is assigned initially in the constructor).

https://github.com/codeceptjs/helper/blob/master/helper.js#L48

Unless I'm misunderstanding something here, I'd expect _setConfig to also be updating config member?

@kobenguyent
Copy link
Contributor

I could be wrong but per my understanding, this.config and this.options have different purposes.

this.config is like the global config of all helpers.

this.options, on the other hand, is the local config of a specific helper.

So let's say you're in a helper and want to call the a particular config parameter of another helper, using this.config.

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

No branches or pull requests

2 participants