-
Notifications
You must be signed in to change notification settings - Fork 5
Decouple more tests from dart:io
#255
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
Conversation
@@ -21,14 +21,14 @@ void tests(FileUtils utils, FileSystem fs) { | |||
late String cwd; | |||
|
|||
setUp(() { | |||
tmp = createTemp('createDirectory'); |
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.
Have you looked at https://pub.dev/packages/test_descriptor ?
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.
That's neat! I hadn't seen that package before.
I don't think that I can use it though because it depends on dart:io. The purpose of this TestUtils
refactor is to (eventually) divorce the tests from dart:io
completely so that you can verify fakes (where the file system objects will exist only in memory).
TestUtils
dart:io
There should be no semantic changes to the tests. Instead of testing
package:io_file
againstdart:io
, the updated tests run each test case twice: once usingdart:io
for setup and verification and once usingpackage:io_file
for setup and verification.Not all tests can be expressed using
package:io_file
(yet).Contribution guidelines:
dart format
.Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.