isolate_bloc_test 0.1.1 icon indicating copy to clipboard operation
isolate_bloc_test: ^0.1.1 copied to clipboard

A testing library which make it easy to test isolate_bloc.

example/main.dart

import 'package:flutter_test/flutter_test.dart';
import 'package:isolate_bloc/isolate_bloc.dart';
import 'package:isolate_bloc_test/isolate_bloc_test.dart';

void main() {
  group('Simple test', () {
    test('Test correct initial state', () async {
      await initializeMock(initializer);
      expect(await createBloc<SimpleBloc, String>().first, '');
    });
  });
}

void initializer() {
  register(create: () => SimpleBloc());
}

class SimpleBloc extends IsolateBloc<Object, String> {
  SimpleBloc() : super('');

  @override
  void onEventReceived(Object event) {
    emit('data');
  }
}
0
likes
100
pub points
0%
popularity

Publisher

unverified uploader

A testing library which make it easy to test isolate_bloc.

Repository (GitHub)

Documentation

API reference

License

Icon for licenses.MIT (LICENSE)

Dependencies

flutter, isolate_bloc

More

Packages that depend on isolate_bloc_test