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

Add customisable userSettings #34

Merged
merged 1 commit into from
Jul 9, 2019

Conversation

kwakwaversal
Copy link
Contributor

userSettings can now be passed in on initialization via
helper.init(runtimepath, userSettings) as well as during the runtime
using helper.settings(userSettings).

This makes it easier for unit tests to emulate their production
environment.

Fixes #21

userSettings can now be passed in on initialization via
`helper.init(runtimepath, userSettings)` as well as during the runtime
using `helper.settings(userSettings)`.

This makes it easier for unit tests to emulate their production
environment.

Fixes node-red#21
@knolleary
Copy link
Member

Thanks for this - sorry for the delay in reviewing, but all looks good.

👍 🚀

@knolleary knolleary merged commit f7424e9 into node-red:master Jul 9, 2019
@cdlans
Copy link

cdlans commented Jul 15, 2019

Thanks for this feature! However this implementation has the same issue #35 as my PR #23 had...

@knolleary
Copy link
Member

@cdlans my apologies. I forgot about #23 and had a specific request to make settings available and this PR popped out.

@cdlans
Copy link

cdlans commented Jul 16, 2019

No problem. I am happy the feature is implemented now. But do you think the issue #35 could be solved? Maybe by cloning the userSettings parameter before modifying it? If not, then I think it should be documented somewhere that the parameter is modified and cannot be reused.

@cdlans
Copy link

cdlans commented Jul 25, 2019

@knolleary do you think cloning the userSettings before modifying it is a good idea? I would be happy to issue a PR.

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.

test-helper does not read settings.js
3 participants