Skip to content

Instantly share code, notes, and snippets.

View mfebrianto's full-sized avatar

michael febrianto mfebrianto

View GitHub Profile
class ReadScreen extends StatefulWidget {
final String bookId;
final LibraryService libraryService;
const ReadScreen({
Key? key,
required this.bookId,
this.libraryService = const LibraryService(),
}) : super(key: key);
@override
_i3.Future<String> getDoc(String? id) => (super.noSuchMethod(
Invocation.method(
#getDoc,
[id],
),
returnValue: _i3.Future<String>.value(''),
) as _i3.Future<String>);
@mfebrianto
mfebrianto / read_screen_test.mocks.dart
Created March 8, 2023 22:20
read_screen_test.mocks.dart
@override
_i3.Future<String> getDoc(String? id) => (super.noSuchMethod(
Invocation.method(
#getDoc,
[id],
),
returnValue: _i3.Future<String>.value(''),
returnValueForMissingStub: _i3.Future<String>.value(''),
) as _i3.Future<String>);
@mfebrianto
mfebrianto / build.gradle
Last active March 14, 2023 22:32
build.gradle for jacoco config on unit test only
// gradle plugin has jacoco that you can use to make your life easier without the
// hassle of manually import and ensure the compatibility
apply plugin: 'jacoco'
jacoco {
// if you are using java 11 then jacoco version that support it is v0.8.7
toolVersion = "0.8.7"
// this is where you find html/xml/csv report for your unit test coverage check
reportsDirectory = file("$buildDir/reports/coverage")
@mfebrianto
mfebrianto / android.yml
Created March 14, 2023 23:10
github action config for android with jacoco coverage test
jobs:
android:
name: android
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Clone repo
uses: actions/checkout@v2
- name: Set up JDK 11