Test your package stable and dev
If you’re using Travis CI, it’s as easy as adding a
dart: entry to your
.travis.yml file. You can specify
stable or both to make sure your code works great on current and future build of the Dart SDK.
See the dartdoc project for an example.
Here’s a build report for
dartdoc on Travis CI.
Getting code coverage with coveralls.io
- Setup an account on coveralls.io using your GitHub account.
- Pick the GitHub repo for your project
- Get the Coveralls “repo token” for the project.
- Populate it in Travis CI Settings as
COVERALLS_TOKEN– or whatever you like.
- Add Coveralls to your
# Fast fail the script on failures.
# Run the tests.
dart --checked test/test_all.dart
# If the COVERALLS_TOKEN token is set on travis
# Install dart_coveralls
# Rerun tests with coverage and send to coveralls
if [ "$COVERALLS_TOKEN" ]; then
pub global activate dart_coveralls
pub global run dart_coveralls report \
--token $COVERALLS_TOKEN \
--retry 2 \
See the source_gen project for an example.
Here’s the coverage report for
source_gen on Coveralls.