test: add property based tests to DataBus
Author: arucilCreated Jan 5, 2023Updated Mar 3, 2026
Labelsgood first issue
I have an idea for this project.
Why?
Property based testing is a testing technique that makes sure the inherent properties of the tested object always hold. Currently there are little guarantee that objects in DataBus satisfy their inherent properties, so property based testing can be added to improve the robustness of DataBus.
What?
Add property based tests to DataBus that test the following properties:
- After a
doCommandoperation,- the
revisionof aDatasheetis always increased by one. - the
id,name, andtypefield of theDatasheetare not changed.
- the
- If a field is added to a
Datasheetthrough thedoCommandoperation,- the number of fields in the
Datasheetand allViews is always increased by one.
- the number of fields in the
How?
The simple way is to conceive some example data and add them to jest tests. Even better, you can use fast-check to generate random tests.
Source: apitable/apitable