-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[triggers] Support
Item
as parameter & Add arg type checks (#194)
* [test] Improve `typeOfArguments` test * [test] Globally mock `@runtime` & OSGi services * [triggers] Support Item as argument & Add type checks Unit tests for triggers can not be extended for Item as argument, because we need to mock Item first. * Remove old & obsolete type defs * Update CHANGELOG * Revert removal of our custom written type defs * Refactor mocking for test of triggers.js. (#1) * Cosmetic changes to comments * Update type defs * [test] triggers: Also test with Item as argument * [test] Fix typo in typeOfArguments.spec.js Also-by: Stefan Friedle <stefan@friedle.de> Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
- Loading branch information
1 parent
269b769
commit 0f05a60
Showing
25 changed files
with
260 additions
and
279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
jest.mock('@runtime', () => ({ | ||
DateTimeType: jest.fn(), | ||
DecimalType: jest.fn(), | ||
StringType: jest.fn(), | ||
QuantityType: jest.fn() | ||
}), { virtual: true }); | ||
|
||
jest.mock('@runtime/Defaults', () => ({}), { virtual: true }); | ||
|
||
jest.mock('@runtime/osgi', () => ({ | ||
bundleContext: { | ||
getServiceReference: jest.fn(), | ||
getService: jest.fn(), | ||
getAllServiceReferences: jest.fn(), | ||
registerService: jest.fn() | ||
}, | ||
lifecycle: { | ||
addDisposeHook: jest.fn() | ||
} | ||
}), { virtual: true }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.