Skip to main content

devpul_test 1.1.0 copy "devpul_test: ^1.1.0" to clipboard
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.

devpul_test #

Test capture for DevPul. Records what the code under test sends to DevPul during dart test and flutter test, integration tests included, and writes a session file for each test that fails: its requests, logs, routes, state and custom events, with the failure as an error and the steps before it. Open the file in the DevPul UI, keep it as a CI artifact, or read it with devpul mcp.

Install #

dev_dependencies:
  devpul_test: ^1.1.0

Usage #

void main() {
  DevpulTest.capture();

  test('places an order', () async {
    await placeOrder();
    expect(cart.items, isEmpty);
  });
}

In Flutter, flutter_test_config.dart covers every test in its folder. recordTestErrors sends the exception testWidgets caught, with the widget behind it:

import 'dart:async';

import 'package:devpul_flutter/devpul_flutter.dart';
import 'package:devpul_test/devpul_test.dart';
import 'package:flutter_test/flutter_test.dart';

Future<void> testExecutable(FutureOr<void> Function() testMain) async {
  DevpulTest.capture();
  reportTestException = DevpulFlutter.recordTestErrors(reportTestException);
  await testMain();
}

A failing test writes build/devpul/<test file without .dart>/<test name>.json and prints the path. See the Tests page.

Limits #

  • Records only what reaches DevPul from the test's own isolate.
  • No files on the web.
  • Integration tests on a phone or emulator cannot write into the project.
0
likes
160
points
60
downloads

Documentation

Documentation
API reference

Publisher

verified publishersaradgajurel.com.np

Weekly Downloads

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.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#debugging #testing #logging #devtools

License

MIT (license)

Dependencies

devpul, stack_trace, test_api

More

Packages that depend on devpul_test