Socket
Book a DemoInstallSign in
Socket

@commercetools/composable-commerce-test-data

Package Overview
Dependencies
Maintainers
6
Versions
133
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@commercetools/composable-commerce-test-data

Data models for commercetools platform APIs

13.4.1
latest
Source
npmnpm
Version published
Weekly downloads
2.1K
7.9%
Maintainers
6
Weekly downloads
 
Created
Source

@commercetools/composable-commerce-test-data

This package provides access to all the test data models used in the commercetools APIs.

Install

$ pnpm add -D @commercetools/composable-commerce-test-data

Usage

This package gives you access to all the test data models available. In order to make sure consumers only pull the models they need, you need to import each one independently.

Example

import {
  ChanelGraphql,
  ChannelDraftGraphql,
  TChannelGraphql,
  TChannelDraftGraphql,
} from '@commercetools/composable-commerce-test-data/channel';
import {
  ProductRest,
  ProductDraftRest,
  TProductRest,
  TProductDraftRest,
} from '@commercetools/composable-commerce-test-data/product';

// This is how to build read models
const channelGraphqlModel: TChannelGraphql = ChannelGraphql.random().build();
const productRestModel: TProductRest = ProductRest.random().build();

// This is how to build write models
const channelDraftGraphqlModel: TChannelDraftGraphql =
  ChannelDraftGraphql.random().build();
const productDraftRestModel: TProductDraftRest =
  ProductDraftRest.random().build();

// Some models also provide presets you can use like this
const foodStoreChannelGraphql: TChannelGraphql = ChannelGraphql.presets
  .foodStore()
  .build();
const happyCowMilkProductRest: TProductRest = ProductRest.presets
  .happyCowMilk()
  .build();

Available test data models

(head to the respective data model directory for more details)

  • associate-role
  • attribute-group
  • business-unit
  • cart
  • cart-discount
  • category
  • channel
  • commons
  • core
  • custom-application
  • custom-object
  • custom-view
  • customer
  • customer-group
  • customers-search-list-my-view
  • discount-code
  • discounts-custom-view
  • filter-values
  • inventory-entry
  • order
  • organization
  • organization-extension
  • payment
  • platform-limits
  • product
  • product-discount
  • product-projection
  • product-selection
  • product-tailoring
  • product-type
  • project
  • project-extension
  • quote
  • quote-request
  • review
  • shipping-method
  • shopping-list
  • staged-quote
  • standalone-price
  • state
  • store
  • tax-category
  • type
  • user
  • zone
  • utils

Keywords

javascript

FAQs

Package last updated on 25 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.