file_testkit 1.0.0 copy "file_testkit: ^1.0.0" to clipboard
file_testkit: ^1.0.0 copied to clipboard

A simple way to mock file-related operations in Dart, ideal for testing.

example/file_testkit_example.dart

import 'dart:io';

import 'package:file_testkit/file_testkit.dart';

void main() async {
  await FileTestkit.runZoned(() async {
    final File file = File('test.txt');

    file.createSync();
    file.writeAsStringSync('hello');

    print('test.txt existed is ${file.existsSync()}');
    if (file.existsSync()) {
      print('file content: ${file.readAsStringSync()}');
    }
  });
}
1
likes
150
points
19
downloads

Publisher

unverified uploader

Weekly Downloads

A simple way to mock file-related operations in Dart, ideal for testing.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

file

More

Packages that depend on file_testkit