file_testing 3.0.0 icon indicating copy to clipboard operation
file_testing: ^3.0.0 copied to clipboard

Testing utilities for package:file

pub package

Testing utilities intended to work with package:file

Features #

This package provides a series of matchers to be used in tests that work with file system types.

Usage #

import 'package:file/file.dart';
import 'package:file/memory.dart';
import 'package:file_testing/file_testing.dart';
import 'package:test/test.dart';

void main() {
  MemoryFileSystem fs;

  setUp(() {
    fs = MemoryFileSystem();
    fs.file('/foo').createSync();
  });

  test('some test', () {
    expectFileSystemException(
      ErrorCodes.ENOENT,
      () {
        fs.directory('').resolveSymbolicLinksSync();
      },
    );
    expect(fs.file('/path/to/file'), isFile);
    expect(fs.file('/path/to/directory'), isDirectory);
    expect(fs.file('/foo'), exists);
  });
}
2
likes
120
pub points
98%
popularity

Publisher

verified publisher icongoogle.dev

Testing utilities for package:file

Documentation

API reference

License

Icon for licenses.BSD-3-Clause (LICENSE)

Dependencies

test

More

Packages that depend on file_testing