57 lines
2.2 KiB
Dart
57 lines
2.2 KiB
Dart
|
|
import 'package:test/test.dart';
|
||
|
|
|
||
|
|
import '../tool/src/check_files.dart';
|
||
|
|
|
||
|
|
void main() {
|
||
|
|
test("our own Dart files are formatted: the apps', the shared packages', the "
|
||
|
|
"tools'", () {
|
||
|
|
for (final path in [
|
||
|
|
'apps/learn/halkyon_learn_flutter/lib/main.dart',
|
||
|
|
'apps/learn/halkyon_learn_server/lib/server.dart',
|
||
|
|
'apps/learn/halkyon_learn_server/test/integration/auth/account_test.dart',
|
||
|
|
'apps/todo/halkyon_todo_flutter/lib/main.dart',
|
||
|
|
'packages/halkyon_app/lib/halkyon_app.dart',
|
||
|
|
'packages/halkyon_base_server/lib/src/auth/email.dart',
|
||
|
|
'tool/check.dart',
|
||
|
|
]) {
|
||
|
|
expect(isOwnDartFile(path), isTrue, reason: path);
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
test('what a generator writes is left as it wrote it', () {
|
||
|
|
for (final path in [
|
||
|
|
// The client packages, Serverpod's from top to bottom.
|
||
|
|
'apps/learn/halkyon_learn_client/lib/src/protocol/client.dart',
|
||
|
|
'apps/todo/halkyon_todo_client/lib/halkyon_todo_client.dart',
|
||
|
|
'packages/halkyon_base_client/lib/src/protocol/protocol.dart',
|
||
|
|
// A server's generated sources and test tools.
|
||
|
|
'apps/learn/halkyon_learn_server/lib/src/generated/protocol.dart',
|
||
|
|
'packages/halkyon_base_server/lib/src/generated/endpoints.dart',
|
||
|
|
'apps/learn/halkyon_learn_server/test/integration/test_tools/serverpod_test_tools.dart',
|
||
|
|
// gen-l10n's localizations, the app's and the shared packages'.
|
||
|
|
'apps/learn/halkyon_learn_flutter/lib/l10n/app_localizations.dart',
|
||
|
|
'apps/learn/halkyon_learn_flutter/lib/l10n/app_localizations_de.dart',
|
||
|
|
'packages/halkyon_ui/lib/l10n/halkyon_ui_localizations_en.dart',
|
||
|
|
'packages/halkyon_app/lib/l10n/halkyon_app_localizations.dart',
|
||
|
|
]) {
|
||
|
|
expect(isOwnDartFile(path), isFalse, reason: path);
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
test('the files of other languages are no Dart files', () {
|
||
|
|
expect(isOwnDartFile('apps/learn/tool/app_icons.py'), isFalse);
|
||
|
|
expect(
|
||
|
|
isOwnDartFile('packages/halkyon_app/lib/l10n/halkyon_app_en.arb'),
|
||
|
|
isFalse,
|
||
|
|
);
|
||
|
|
});
|
||
|
|
|
||
|
|
test("Melos' filters take only what changed since a commit, and what depends "
|
||
|
|
'on it, when asked', () {
|
||
|
|
expect(melosFilters(), isEmpty);
|
||
|
|
expect(melosFilters(changedSince: 'origin/main'), [
|
||
|
|
'--diff=origin/main',
|
||
|
|
'--include-dependents',
|
||
|
|
]);
|
||
|
|
});
|
||
|
|
}
|