isTimestamp top-level property

Matcher isTimestamp
getter/setter pair

Validates that a value is a ISO8601 timestamp.

Usage:

    var response = await client.request("/foo").get();
    expect(response, hasResponse(200, {"createdDate": isTimestamp}));

Implementation

Matcher isTimestamp = predicate((String str) {
  try {
    return DateTime.parse(str) != null;
  } catch (e) {
    return false;
  }
}, "is timestamp");