| import 'package:path/path.dart' as p; |
| import 'package:test/test.dart'; |
| import '../bin/format_coverage.dart'; |
| testDir = Directory.systemTemp.createTempSync('coverage_test_temp'); |
| if (testDir.existsSync()) testDir.deleteSync(recursive: true); |
| test('considers all json files', () async { |
| final fileA = File(p.join(testDir.path, 'coverage_a.json')); |
| final fileB = File(p.join(testDir.path, 'coverage_b.json')); |
| final fileC = File(p.join(testDir.path, 'not_coverage.foo')); |
| final files = filesToProcess(testDir.path); |
| expect(files.length, equals(2)); |
| files.map((f) => f.path), |
| [endsWith('coverage_a.json'), endsWith('coverage_b.json')])); |