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 csdx plugins:link) |
From repo root: pnpm --filter contentstack-cli-tsgen …
Config
jest.config.js: ts-jest,testEnvironment: node.
Integration tests
- tests/integration/tsgen.integration.test.ts spawns
csdx tsgenwithTOKEN_ALIAS. - Loads
.envfrom package root viadotenv.TOKEN_ALIASmust be defined or the suite throws at load time.
CI
.github/workflows/tsgen-integration-test.yml:pnpm install, build, global@contentstack/cli, token setup,csdx plugins:link,test:integrationwith secrets..github/workflows/unit-test.yml→npm run testin this package.
Source: contentstack/cli-plugins — distributed by TomeVault.