createMemoryTests method

List<PendingTest> createMemoryTests (
  1. dynamic object,
  2. {bool ignoreImages = true}

Creates a list of Test objects from a given dynamic object. The dynamic object must be either a List of Map objects or an individual Map object that follow the structure defined in Test.fromDynamic.

The optional ignoreImages parameter can be used to save memory when a large number of tests are loaded. By ignoring the images, the memory required to host those images is removed.

This will never return null. If no tests exists in the object then this will return an empty array.


static List<PendingTest> createMemoryTests(dynamic object,
    {bool ignoreImages = true}) {
  List<PendingTest> tests;

  if (object is List) {
    var tempTests = JsonClass.fromDynamicList(
      (map) => Test.fromDynamic(map),
      (test) =>
 != true && test.steps?.isNotEmpty != true,

    tests = [];
    for (var t in tempTests) {
  } else {
    var test = Test.fromDynamic(object);

    if ( == true && test.steps?.isNotEmpty == true) {
      tests = [PendingTest.memory(test)];

  return tests ?? <Test>[];