Skip to content
This repository has been archived by the owner on Jun 22, 2024. It is now read-only.
/ welltested Public archive

welltested is a code testing autopilot for flutter and dart projects.

License

Notifications You must be signed in to change notification settings

CommandDash/welltested

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

welltested

Welltested is an AI testing autopilot for Flutter developers add and maintain intelligent tests coverage and deliver stable welltested apps to users.

Generate and Configure API Key

🗝️ Generate API Key

Welltested is completely free for individual developers. To create an account, please sign up here.

⚙️ Configure API Key

Create a .env file in root of your project, and add your key received in the email.

WELLTESTED_API=YOUR_API_KEY

We uses dotenv to retrive API Key. Once .env file is created, please declare it as an asset in pubspec.yaml to make is accessible to the package.

assets:
  - .env

Let's create tests

Add the @Welltested() annotation to the class whose methods are to be tested.

@Welltested()
class Auth {
    Future<void> logInUser() {...}
    Future<void> logOutUser() {...}
}

In the above case, it will generate unit tests for logInUser and logOutUser methods of Auth class.

Exclude Methods

By default, all methods in an annotated class are included. To exclude any method from testing, add their name to the excludedMethods list in the Welltested annotation.

@Welltested(excludedMethods: ['logOutUser'])
class Auth {
    Future<void> logInUser() {...}
    Future<void> logOutUser() {...}
}

In the above case, it will not create unit tests for logOutUser method.

Custom Testcases

To specify custom testcases for any method, use @Testcases() annotation.

@Welltested()
class Auth {
    @Testcases(['Throws exception when email is empty'])
    Future<User> logInUser() {...}
}

Generate Tests

To generate unit tests for annotated classes, please run the following command:

dart run welltested:ai build

Saving Tests

At times, tests generated by welltested might have syntax issues. When encountering such issues, please makes the fixes and run the below command to save your changes. We remember your fixes and don't repeat the mistake.

dart run welltested:save build

USAGE WIKI

To read detailed setup instructions, code guidelines and supported platform infromation, read our Usage Wiki.

NOTE

  1. The minimum supported Flutter SDK version is 3.0.0 with Dart SDK 2.17.0. Any prior projects need to be upgraded for welltested to work.

For complete Example please check example project.

About

welltested is a code testing autopilot for flutter and dart projects.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published