mockserver 1.2.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 68

Mockserver #

A mock server for Dart.

Example #

final List<EndPoint> endPoints = [
  // end points
];

final MockServer mockServer = MockServer(
  port: 8080,
  endPoints: endPoints,
);
await mockServer.start();

[1.0.0] - 2020-05-26 #

  • First version

[1.1.0] - 2020-05-28 #

  • Added request and response extensions

[1.2.0] - 2020-05-29 #

  • Added unit tests. Code refactoring

[1.2.1] - 2020-05-30 #

  • Fixed path matching bug

example/main.dart

import 'package:mockserver/src/mockserver/mock_server.dart';
import 'package:mockserver/src/mockserver/end_point.dart';

Future<dynamic> main() async {
  final List<EndPoint> endPoints = [
    // end points
  ];

  final MockServer mockServer = MockServer(
    port: 8080,
    endPoints: endPoints,
  );
  await mockServer.start();
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  mockserver: ^1.2.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:mockserver/mockserver.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
36
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
68
Learn more about scoring.

We analyzed this package on Jul 2, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13

Analysis suggestions

Package not compatible with runtime flutter-web on web

Because of the import of dart:io via the import chain package:mockserver/mockserver.dartpackage:mockserver/src/mockserver/mock_server.dartpackage:mockserver/src/mockserver/end_point.dartdart:io

Package not compatible with runtime web

Because of the import of dart:io via the import chain package:mockserver/mockserver.dartpackage:mockserver/src/mockserver/mock_server.dartpackage:mockserver/src/mockserver/end_point.dartdart:io

Health issues and suggestions

Document public APIs. (-1 points)

108 out of 108 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.8.0 <3.0.0
Dev dependencies
build_runner ^1.10.0
test ^1.14.5