devpul_test 1.1.0
devpul_test: ^1.1.0 copied to clipboard
Records DevPul events during Dart and Flutter tests and writes a session file for each test that fails, to open in the DevPul browser UI.
example/devpul_test_example.dart
import 'package:devpul/devpul.dart';
import 'package:devpul_test/devpul_test.dart';
import 'package:test/test.dart';
// dart test example/devpul_test_example.dart
// The failing test writes build/devpul/example/devpul_test_example/...json.
void main() {
DevpulTest.capture();
test('adds an item to the cart', () {
Devpul.log('Adding abc-1');
Devpul.emit('cart.add', {'sku': 'abc-1', 'qty': 2});
expect(cartSize(), 2);
});
}
int cartSize() => 1;