Skip to content

Add unit and integration tests #37

@nam-hle

Description

@nam-hle

Summary

Add test coverage for core plugin logic. The codebase currently has zero tests.

Motivation

As the plugin grows, regressions become likely. Tests for the foundational utilities and scanners provide a safety net and enable confident refactoring.

Acceptance Criteria

  • NadleFileUtil tests: config file pattern matching, task name extraction, regex edge cases
  • NadleTaskScanner tests: single file scanning, monorepo prefix generation, skip-directory logic
  • NodeJsResolver tests: fallback chain behavior, path resolution order
  • NadleTaskGotoDeclarationHandler tests: PSI navigation for dependsOn references
  • CI runs tests on every PR (if CI exists)

Implementation Notes

  • Use IntelliJ Platform test framework (BasePlatformTestCase or LightPlatformCodeInsightTestCase)
  • Place tests in src/test/kotlin/ mirroring the main source structure
  • For PSI-dependent tests, use test fixtures with sample nadle.config.ts files
  • Pure logic tests (file util, scanner) can use plain JUnit

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: lowTier 3/4 — Quality, robustness, nice-to-havetestingTesting and test infrastructure

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions