@commercetools-test-data/core

This package provides the core functions to define the data models

Usage no npm install needed!

<script type="module">
  import commercetoolsTestDataCore from 'https://cdn.skypack.dev/@commercetools-test-data/core';
</script>

README

commercetools Test Data 🤖

✨ Monorepository with test data models for commercetools platform entities 🛠

Latest release GitHub license

This repository contains data models within the commercetools platform ecosystem.

In time, we will continue to implement and open source test data models. If you are interested or missing a specific data model, feel free to open a feature request or try to contribute to the repository.

Models are defined in the models/* workspace and are grouped by domain in different packages.

All models are built using the core package, which contains the necessary methods to implement and work with models. The core package is very much agnostic of the commercetools platform domain, so you can potentially use it to build your own models for other domains.

To know more about how to work and build data models, check out the documentation of the core package.

Usage

Using models is pretty straightforward. You import the package and build the model, which returns the data in the requested shape.

For example, assuming we have an Author model from a stories package:

import type { TAuthor } from '@commercetools-test-data/stories';

import { Author } from '@commercetools-test-data/stories';

const author1 = Author.random().firstName('John').buildGraphql<TAuthor>();
const author2 = Author.random().firstName('Rebecca').buildGraphql<TAuthor>();