DevXMessageConnector Local Testing
This guide explains how to run the DevXMessageConnector unit tests locally.
What These Tests Cover
The current Vitest suite is scoped to the DevXMessageConnector node in community-nodes.
- Test files live in
community-nodes/tests/DevXMessageConnector - Shared test utilities live in
community-nodes/tests/DevXMessageConnector/helpers.ts - Vitest is configured in
community-nodes/vitest.config.ts - The test command is defined in
community-nodes/package.json
The tests exercise node-level behavior only. They validate how DevXMessageConnector.execute() routes payloads by type and source, transforms message content, handles invalid payloads, and builds outbound requests.
Prerequisites
Before running the tests locally, make sure you have the repo checked out and the project tooling installed.
- Follow
docs/development-setup/local-development-environment.mdif you have not set up the repo yet - Make sure
pnpmis available in your shell - Install dependencies in
community-nodes
Install Dependencies
From the repository root:
cd community-nodes
pnpm install
Run All DevXMessageConnector Tests
From community-nodes:
pnpm test
This runs:
vitest run
Vitest picks up test files from:
tests/**/*.test.ts
Run a Single Test File
If you only want to run one source-specific suite, use Vitest directly.
Examples:
pnpm exec vitest run tests/DevXMessageConnector/github.test.ts
pnpm exec vitest run tests/DevXMessageConnector/html.test.ts
pnpm exec vitest run tests/DevXMessageConnector/node.test.ts
Current Test Layout
The suite is split by node behavior and source type:
community-nodes/tests/DevXMessageConnector/node.test.tscommunity-nodes/tests/DevXMessageConnector/text.test.tscommunity-nodes/tests/DevXMessageConnector/html.test.tscommunity-nodes/tests/DevXMessageConnector/generic.test.tscommunity-nodes/tests/DevXMessageConnector/rocket-chat.test.tscommunity-nodes/tests/DevXMessageConnector/github.test.tscommunity-nodes/tests/DevXMessageConnector/backup-container.test.tscommunity-nodes/tests/DevXMessageConnector/sysdig.test.tscommunity-nodes/tests/DevXMessageConnector/uptime-com.test.ts
Common Local Commands
Run the full suite:
cd community-nodes
pnpm test
Run one file:
cd community-nodes
pnpm exec vitest run tests/DevXMessageConnector/sysdig.test.ts
Run multiple DevXMessageConnector files:
cd community-nodes
pnpm exec vitest run tests/DevXMessageConnector/github.test.ts tests/DevXMessageConnector/node.test.ts