How to use the json-schema-faker.reset function in json-schema-faker

To help you get started, we’ve selected a few json-schema-faker examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github unmock / unmock-js / packages / unmock-core / src / generator.ts View on Github external
...(isReference(bodySchema.value)
              ? changeRef(bodySchema.value)
              : changeRefs(bodySchema.value)),
          },
    });

    // Notify call tracker
    const serviceName = toSchemas
      .composeLens(keyLens())
      .getOption(schemaRecord);
    if (!isNone(serviceName) && store.cores[serviceName.value]) {
      store.cores[serviceName.value].track({ req, res });
    }

    listeners.forEach((listener: IListener) => listener.notify({ req, res }));
    jsf.reset();
    return res;
  };
}
github unmock / unmock-js / packages / unmock-core / src / generator-experimental.ts View on Github external
: {
              definitions,
              ...(isReference(bodySchema.value)
                ? changeRef(bodySchema.value)
                : changeRefs(bodySchema.value)),
            });
      // Notify call tracker
      const serviceName = toSchemas
        .composeLens(keyLens())
        .getOption(schemaRecord);
      if (!isNone(serviceName) && store.cores[serviceName.value]) {
        store.cores[serviceName.value].track({ req, res });
      }

      listeners.forEach((listener: IListener) => listener.notify({ req, res }));
      jsf.reset();
      return res;
    };
}