Skip to content

Latest commit

 

History

History
28 lines (20 loc) · 636 Bytes

ex6-1.md

File metadata and controls

28 lines (20 loc) · 636 Bytes

6.1 Adding the Dart Test Package to Your Application

Example Code:

The command dart pub add test --dev adds the test package to your project as a development dependency. The test package provides a testing framework for Dart.

dart pub add test --dev

To use the test package, you need to import it into your code:

import 'package:test/test.dart';

You can then write tests using the test() function:

void main() {
  test('This is a test', () {
    // Your test code goes here.
  });
}

To use the test package, please see the documentation: test package.