Skip to main content

Testing

Testing is a core requirement for contributing to NDM. Every change — even small ones — must be covered by tests.

General Rules​

Every change requires tests. No exceptions.

Rewrite outdated tests. If an existing test no longer reflects the current behavior, update it.

Add new tests for new features. All new logic must be fully covered.

Do not leave commented‑out tests. Remove unused test code.

Vitest​

NDM uses Vitest because it has a wide ecosystem, fast performance, and excellent compatibility with modern TypeScript tooling.

Running Tests​

pnpm test

Watching Tests​

pnpm test:watch

Vitest integrates seamlessly with the project structure and supports snapshot testing, mocking, coverage reports, and more.

Linter and Formatter​

danger

The PR isn't accepted if there are any Linter or Formatter errors.

tip

For checking the Linter run:

pnpm lint
tip

For checking the Formatter run:

pnpm format