AppFlowy is becoming a complex application, in order to maintain stability, we encourage developers to write more tests. Testing your code ensures that the software you develop works as expected and makes it less vulnerable to attackers.
This article will cover:
- The tests in AppFlowy
- How to run the tests in AppFlowy
- How to write a test in AppFlowy
- Code coverage
AppFlowy is written in Dart and Rust. We call it frontend
tests in Dart
and Backend
tests in Rust
.
The frontend tests locate in frontend/app_flowy/test.
It contains three folders. The bloc test folder, integration test folder, and widget test folder.
bloc test | It contains the bloc tests of AppFlowy. |
---|---|
widget test | It contains the widget tests of AppFlowy. |
integration test | It contains the integration tests of AppFlowy |
When creating a new test, you should put it in the right folder.
WIP
In order to run the tests one by one, it needs to build the Backend library first.
// Make sure your current path is AppFlowy/frontend
cargo make build-test-lib
After building the Backend library, you can click the Run|Debug
button to run the test.
// Make sure your current path is AppFlowy/frontend
cargo make dart_unit_test
WIP
WIP