-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Replace randomness in tests with deterministic randomness. #1320
Changes from 7 commits
6a2c295
d11af6e
319d8b4
f262260
f01c02b
e806efe
72edc2a
f26812c
98f04c2
55c128d
0516540
e39b5c4
8b02590
bf5de40
b100ad3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ import 'package:common_domain_models/common_domain_models.dart'; | |
import 'package:files_basics/files_models.dart'; | ||
import 'package:files_basics/local_file.dart'; | ||
|
||
import 'package:random_string/random_string.dart'; | ||
import 'package:test_randomness/test_randomness.dart'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider adding documentation or comments explaining the purpose and usage of the |
||
import 'package:rxdart/subjects.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,8 @@ dependencies: | |
path: ../bloc_base | ||
# For teacher fake bloc currently in use (can be removed when bloc is implemented) | ||
# https://gitlab.com/codingbrain/sharezone/sharezone-app/-/issues/1460 | ||
random_string: ^2.0.1 | ||
test_randomness: | ||
path: ../test_randomness | ||
Comment on lines
+31
to
+32
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't this dependency only used in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, because the method |
||
|
||
dev_dependencies: | ||
async: ^2.11.0 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, the test file appears well-structured and comprehensive, covering a wide range of scenarios for the HomeworkDialog component. However, it's essential to ensure that all randomness in tests, such as generating random IDs, booleans, or other data, now utilizes the
test_randomness
package's functionalities to maintain determinism. This approach will enhance the reproducibility of test scenarios and facilitate debugging when tests fail. Additionally, consider reviewing the entire test suite for consistency in using the new deterministic randomness approach and ensuring that all tests adhere to best practices for clarity, maintainability, and efficiency.