Skip to content

Latest commit

 

History

History
100 lines (74 loc) · 2.4 KB

CONTRIBUTING.md

File metadata and controls

100 lines (74 loc) · 2.4 KB

Contributing

Roadmap

There are some outstanding endpoints that are outstanding. Feel free to look at the Test Rail docs and create a pr for the new models.

Guidelines

This repo is perfect for people looking to make their first contribution to open source.

You can checkout this guide in order to learn how to fork our branch and make your first contribution.

You can use the app Quick Type to autogenerate the expected responses for the models from the above endpoints then you can clean it up to follow our style guide below.

Dart Style Guide

The purpose of this styling guide is to provide a consistent format to make contributions to our Dart app. We align as much as possible with the best practices set forth by the Flutter team.

Writing Unit Tests

Generally speaking, keeping expect() as close to one as possible per test helps them stay resilient to refactors. (assert one behavior as it won't break unrelated tests when that functionality changes).

We created a helper stubTestRailConfig which you can use in order to pass in sample data for the testcase.

void main() {
  group('TestSection', () {
    test('#get', () async {
      stubTestRailConfig(sampleTestCase);
      final result = await TestCase.get(1);
      expect(result.asJson, sampleTestCase);
    });
  });
}

Styling

Declaration

Do create declarations that are immutable as much as possible

/// bad
var response = 'www.dutchie.com';

/// good
final response = 'www.dutchie.com';
const response = 'www.dutchie.com';

Trailing Commas

Do Add a trailing comma as it makes code more readable when its closing brackets are on a new line

// bad
TestCase({
  this.createdBy,
  this.createdOn,
  this.suiteId});

/// good
TestCase({
  this.createdBy,
  this.createdOn,
  this.suiteId,
});

Ordering

  • instance fields
  • static fields
  • constructor
  • instance methods
  • static methods
class Example {
  final int age;
  final int get dogName {
    return age * 7;
  }
  final String name;
  static const List<String> names = <String>[];

  Example(
    this.age,
    this.name,
  );

  String sayName(String name) {
    print("My name is $name")
  }

  static void saveName(String name) {
    names.add(name);
  }
}