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

[triggers] Support Item as parameter & Add arg type checks #194

Merged
merged 11 commits into from
Dec 19, 2022

Conversation

florian-h05
Copy link
Contributor

@florian-h05 florian-h05 commented Dec 11, 2022

Fixes #176.

Description

  • Improve tests for typeOfArguments
  • Globally mock @runtime and OSGi services (preparation for changes to triggers.js)
  • [triggers] Support Item as argument for appropriate triggers
  • [triggers] Add argument type checks
  • Remove old type definitions
  • Exclude some files from type definitions

Testing

All changes to triggers.js are automatically tested by our unit tests.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Unit tests for triggers can not be extended for Item as argument, because we need to mock Item first.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
@florian-h05 florian-h05 added enhancement New feature or request infrastructure Build and test infrastructur and workflows labels Dec 11, 2022
@florian-h05 florian-h05 added this to the to be released milestone Dec 11, 2022
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
@florian-h05
Copy link
Contributor Author

@sfriedle Can you please review? Especially my changes to the unit tests please.

@florian-h05 florian-h05 requested a review from jpg0 December 11, 2022 19:27
@florian-h05 florian-h05 changed the title [triggers] Support Item as parameter & Add arg type checks [Do NOT merge] [triggers] Support Item as parameter & Add arg type checks Dec 11, 2022
@florian-h05
Copy link
Contributor Author

Since the feature freeze is active now, this can not be merged before the release of 3.4.0 stable — only bug fixes are allowed from now on.

test/@runtime.mock.js Outdated Show resolved Hide resolved
sfriedle and others added 4 commits December 12, 2022 16:04
Signed-off-by: Stefan Friedle <stefan@friedle.de>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Copy link
Contributor

@sfriedle sfriedle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found a typo. For the rest: LGTM.

test/typeOfArguments.spec.js Outdated Show resolved Hide resolved
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>

Co-authored-by: Stefan Friedle <sfriedle@users.noreply.github.com>
@florian-h05 florian-h05 changed the title [Do NOT merge] [triggers] Support Item as parameter & Add arg type checks [triggers] Support Item as parameter & Add arg type checks Dec 19, 2022
@florian-h05 florian-h05 merged commit 0f05a60 into openhab:main Dec 19, 2022
@florian-h05 florian-h05 deleted the triggers-improvements branch December 19, 2022 16:39
florian-h05 added a commit that referenced this pull request Dec 20, 2022
This should avoid that triggers get broken in the future like it happened in #194.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request infrastructure Build and test infrastructur and workflows
Projects
None yet
2 participants