Skip to content

Commit

Permalink
Added script install test
Browse files Browse the repository at this point in the history
  • Loading branch information
leoafarias committed Mar 13, 2024
1 parent 5bc7831 commit f54f4ae
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
4 changes: 0 additions & 4 deletions .github/actions/prepare/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,3 @@ runs:
- name: Build Version
run: dart run build_runner build --delete-conflicting-outputs
shell: bash

- name: Move public install scripts
run: dart run grinder move-scripts
shell: bash
27 changes: 27 additions & 0 deletions test/ensure_build_test.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,33 @@
import 'dart:io';

import 'package:build_verify/build_verify.dart';
import 'package:path/path.dart';
import 'package:test/test.dart';

void main() {
test('ensure_build', expectBuildClean);
test('install scripts have been moved', () {
final sourceInstall = File(join('scripts', 'install.sh'));
final sourceUninstall = File(join('scripts', 'uninstall.sh'));

final targetInstall = File(join('docs', 'public', 'install.sh'));
final targetUninstall = File(join('docs', 'public', 'uninstall.sh'));

expect(
sourceInstall.existsSync() && sourceUninstall.existsSync(),
isTrue,
reason: 'install.sh and uninstall.sh exist',
);
expect(
sourceInstall.readAsStringSync(),
targetInstall.readAsStringSync(),
reason: 'Install scripts are the same',
);

expect(
sourceUninstall.readAsStringSync(),
targetUninstall.readAsStringSync(),
reason: 'Uninstall scripts are the same',
);
});
}

0 comments on commit f54f4ae

Please sign in to comment.