Skip to content

Latest commit

 

History

History
32 lines (21 loc) · 1.55 KB

File metadata and controls

32 lines (21 loc) · 1.55 KB
name testing
description How to run tests and use env for contentstack-cli-tsgen (Jest, ESLint posttest, integration).

Testing skill (contentstack-cli-tsgen)

This package is the only cli-plugins package that uses Jest (other plugins use Mocha).

Commands

Command What it does
pnpm test Jest with --testPathPattern=tests; then posttest runs ESLint
pnpm run test:integration Jest only for tests/integration
pnpm run build Build lib/ (required before local csdx plugins:link)

From repo root, prefix with pnpm --filter contentstack-cli-tsgen.

Config

Integration tests

CI

  • .github/workflows/tsgen-integration-test.yml: pnpm install, pnpm --filter contentstack-cli-tsgen run build, global @contentstack/cli@beta, csdx config:set:region, csdx auth:tokens:add (delivery), csdx plugins:link, pnpm --filter contentstack-cli-tsgen run test:integration with TOKEN_ALIAS secret.
  • Lint on PR: .github/workflows/unit-test.yml → pnpm run lint in this package.