agentic-qe 3.7.8 → 3.7.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/skills/debug-loop/SKILL.md +1 -1
- package/.claude/skills/enterprise-integration-testing/evals/enterprise-integration-testing.yaml +158 -0
- package/.claude/skills/enterprise-integration-testing/schemas/output.json +74 -0
- package/.claude/skills/enterprise-integration-testing/scripts/validate-config.json +25 -0
- package/.claude/skills/middleware-testing-patterns/evals/middleware-testing-patterns.yaml +153 -0
- package/.claude/skills/middleware-testing-patterns/schemas/output.json +58 -0
- package/.claude/skills/middleware-testing-patterns/scripts/validate-config.json +25 -0
- package/.claude/skills/observability-testing-patterns/evals/observability-testing-patterns.yaml +157 -0
- package/.claude/skills/observability-testing-patterns/schemas/output.json +58 -0
- package/.claude/skills/observability-testing-patterns/scripts/validate-config.json +25 -0
- package/.claude/skills/pr-review/SKILL.md +1 -1
- package/.claude/skills/qcsd-cicd-swarm/evals/qcsd-cicd-swarm.yaml +211 -0
- package/.claude/skills/qcsd-cicd-swarm/schemas/output.json +86 -0
- package/.claude/skills/qcsd-cicd-swarm/scripts/validate-config.json +30 -0
- package/.claude/skills/qcsd-development-swarm/evals/qcsd-development-swarm.yaml +162 -0
- package/.claude/skills/qcsd-development-swarm/schemas/output.json +72 -0
- package/.claude/skills/qcsd-development-swarm/scripts/validate-config.json +25 -0
- package/.claude/skills/skills-manifest.json +1 -1
- package/.claude/skills/trust-tier-manifest.json +78 -7
- package/CHANGELOG.md +20 -0
- package/assets/skills/a11y-ally/SKILL.md +1664 -1658
- package/assets/skills/a11y-ally/evals/a11y-ally.yaml +376 -0
- package/assets/skills/a11y-ally/schemas/output.json +549 -0
- package/assets/skills/a11y-ally/scripts/validate-config.json +42 -0
- package/assets/skills/brutal-honesty-review/SKILL.md +5 -0
- package/assets/skills/brutal-honesty-review/schemas/output.json +291 -0
- package/assets/skills/brutal-honesty-review/scripts/validate-config.json +34 -0
- package/assets/skills/cicd-pipeline-qe-orchestrator/README.md +1 -1
- package/assets/skills/cicd-pipeline-qe-orchestrator/SKILL.md +6 -0
- package/assets/skills/cicd-pipeline-qe-orchestrator/evals/cicd-pipeline-qe-orchestrator.yaml +157 -0
- package/assets/skills/cicd-pipeline-qe-orchestrator/schemas/output.json +542 -0
- package/assets/skills/cicd-pipeline-qe-orchestrator/scripts/validate-config.json +42 -0
- package/assets/skills/debug-loop/SKILL.md +1 -1
- package/assets/skills/enterprise-integration-testing/evals/enterprise-integration-testing.yaml +158 -0
- package/assets/skills/enterprise-integration-testing/schemas/output.json +74 -0
- package/assets/skills/enterprise-integration-testing/scripts/validate-config.json +25 -0
- package/assets/skills/middleware-testing-patterns/evals/middleware-testing-patterns.yaml +153 -0
- package/assets/skills/middleware-testing-patterns/schemas/output.json +58 -0
- package/assets/skills/middleware-testing-patterns/scripts/validate-config.json +25 -0
- package/assets/skills/n8n-expression-testing/SKILL.md +6 -0
- package/assets/skills/n8n-expression-testing/evals/n8n-expression-testing.yaml +450 -0
- package/assets/skills/n8n-expression-testing/schemas/output.json +369 -0
- package/assets/skills/n8n-expression-testing/scripts/validate-config.json +39 -0
- package/assets/skills/n8n-integration-testing-patterns/SKILL.md +6 -0
- package/assets/skills/n8n-integration-testing-patterns/evals/n8n-integration-testing-patterns.yaml +522 -0
- package/assets/skills/n8n-integration-testing-patterns/schemas/output.json +291 -0
- package/assets/skills/n8n-integration-testing-patterns/scripts/validate-config.json +34 -0
- package/assets/skills/n8n-security-testing/SKILL.md +6 -0
- package/assets/skills/n8n-security-testing/evals/n8n-security-testing.yaml +493 -0
- package/assets/skills/n8n-security-testing/schemas/output.json +293 -0
- package/assets/skills/n8n-security-testing/scripts/validate-config.json +34 -0
- package/assets/skills/n8n-trigger-testing-strategies/SKILL.md +6 -0
- package/assets/skills/n8n-trigger-testing-strategies/evals/n8n-trigger-testing-strategies.yaml +500 -0
- package/assets/skills/n8n-trigger-testing-strategies/schemas/output.json +295 -0
- package/assets/skills/n8n-trigger-testing-strategies/scripts/validate-config.json +34 -0
- package/assets/skills/n8n-workflow-testing-fundamentals/SKILL.md +6 -0
- package/assets/skills/n8n-workflow-testing-fundamentals/evals/n8n-workflow-testing-fundamentals.yaml +497 -0
- package/assets/skills/n8n-workflow-testing-fundamentals/schemas/output.json +254 -0
- package/assets/skills/n8n-workflow-testing-fundamentals/scripts/validate-config.json +35 -0
- package/assets/skills/observability-testing-patterns/evals/observability-testing-patterns.yaml +157 -0
- package/assets/skills/observability-testing-patterns/schemas/output.json +58 -0
- package/assets/skills/observability-testing-patterns/scripts/validate-config.json +25 -0
- package/assets/skills/pentest-validation/scripts/validate-config.json +12 -0
- package/assets/skills/pr-review/SKILL.md +1 -1
- package/assets/skills/qcsd-cicd-swarm/evals/qcsd-cicd-swarm.yaml +211 -0
- package/assets/skills/qcsd-cicd-swarm/schemas/output.json +86 -0
- package/assets/skills/qcsd-cicd-swarm/scripts/validate-config.json +30 -0
- package/assets/skills/qcsd-development-swarm/evals/qcsd-development-swarm.yaml +162 -0
- package/assets/skills/qcsd-development-swarm/schemas/output.json +72 -0
- package/assets/skills/qcsd-development-swarm/scripts/validate-config.json +25 -0
- package/assets/skills/qcsd-ideation-swarm/evals/qcsd-ideation-swarm.yaml +138 -0
- package/assets/skills/qcsd-ideation-swarm/schemas/output.json +568 -0
- package/assets/skills/qcsd-ideation-swarm/scripts/validate-config.json +25 -0
- package/assets/skills/qcsd-production-swarm/SKILL.md +2781 -0
- package/assets/skills/qcsd-production-swarm/evals/qcsd-production-swarm.yaml +246 -0
- package/assets/skills/qcsd-production-swarm/schemas/output.json +505 -0
- package/assets/skills/qcsd-production-swarm/scripts/validate-config.json +25 -0
- package/assets/skills/qcsd-refinement-swarm/evals/qcsd-refinement-swarm.yaml +139 -0
- package/assets/skills/qcsd-refinement-swarm/schemas/output.json +811 -0
- package/assets/skills/qcsd-refinement-swarm/scripts/validate-config.json +25 -0
- package/assets/skills/security-visual-testing/scripts/validate-config.json +45 -0
- package/assets/skills/sherlock-review/SKILL.md +5 -0
- package/assets/skills/sherlock-review/schemas/output.json +297 -0
- package/assets/skills/sherlock-review/scripts/validate-config.json +35 -0
- package/assets/skills/testability-scoring/SKILL.md +5 -0
- package/assets/skills/testability-scoring/evals/testability-scoring.yaml +814 -0
- package/assets/skills/testability-scoring/schemas/output.json +606 -0
- package/assets/skills/testability-scoring/scripts/validate-config.json +42 -0
- package/assets/skills/trust-tier-manifest.json +2404 -0
- package/assets/skills/wms-testing-patterns/evals/wms-testing-patterns.yaml +165 -0
- package/assets/skills/wms-testing-patterns/schemas/output.json +150 -0
- package/assets/skills/wms-testing-patterns/scripts/validate-config.json +51 -0
- package/dist/benchmarks/performance-benchmarks.js +1 -1
- package/dist/cli/bundle.js +9130 -2283
- package/dist/cli/commands/hooks.d.ts.map +1 -1
- package/dist/cli/commands/hooks.js +92 -0
- package/dist/cli/commands/hooks.js.map +1 -1
- package/dist/cli/commands/migrate.js +2 -2
- package/dist/coordination/constants.d.ts +1 -1
- package/dist/coordination/constants.js +1 -1
- package/dist/coordination/handlers/coverage-handlers.js +1 -1
- package/dist/coordination/handlers/coverage-handlers.js.map +1 -1
- package/dist/domains/code-intelligence/services/semantic-analyzer.d.ts +1 -1
- package/dist/domains/code-intelligence/services/semantic-analyzer.d.ts.map +1 -1
- package/dist/domains/code-intelligence/services/semantic-analyzer.js +1 -1
- package/dist/domains/code-intelligence/services/semantic-analyzer.js.map +1 -1
- package/dist/domains/coverage-analysis/coordinator.js +1 -1
- package/dist/domains/coverage-analysis/services/coverage-analyzer.js +1 -1
- package/dist/domains/coverage-analysis/services/coverage-embedder.d.ts +1 -1
- package/dist/domains/coverage-analysis/services/coverage-embedder.js +1 -1
- package/dist/domains/coverage-analysis/services/gap-detector.js +1 -1
- package/dist/domains/coverage-analysis/services/ghost-coverage-analyzer.js +1 -1
- package/dist/domains/coverage-analysis/services/hnsw-index.d.ts +2 -2
- package/dist/domains/coverage-analysis/services/hnsw-index.js +3 -3
- package/dist/domains/coverage-analysis/services/sublinear-analyzer.d.ts +1 -1
- package/dist/domains/coverage-analysis/services/sublinear-analyzer.js +1 -1
- package/dist/domains/test-execution/services/test-prioritizer.js +1 -1
- package/dist/domains/test-generation/context/rust-context-builder.d.ts +31 -0
- package/dist/domains/test-generation/context/rust-context-builder.d.ts.map +1 -0
- package/dist/domains/test-generation/context/rust-context-builder.js +27 -0
- package/dist/domains/test-generation/context/rust-context-builder.js.map +1 -0
- package/dist/domains/test-generation/coordinator.js +3 -3
- package/dist/domains/test-generation/coordinator.js.map +1 -1
- package/dist/domains/test-generation/detectors/mobile-detector.d.ts +41 -0
- package/dist/domains/test-generation/detectors/mobile-detector.d.ts.map +1 -0
- package/dist/domains/test-generation/detectors/mobile-detector.js +111 -0
- package/dist/domains/test-generation/detectors/mobile-detector.js.map +1 -0
- package/dist/domains/test-generation/detectors/spring-detector.d.ts +22 -0
- package/dist/domains/test-generation/detectors/spring-detector.d.ts.map +1 -0
- package/dist/domains/test-generation/detectors/spring-detector.js +37 -0
- package/dist/domains/test-generation/detectors/spring-detector.js.map +1 -0
- package/dist/domains/test-generation/factories/test-generator-factory.d.ts +2 -1
- package/dist/domains/test-generation/factories/test-generator-factory.d.ts.map +1 -1
- package/dist/domains/test-generation/factories/test-generator-factory.js +33 -13
- package/dist/domains/test-generation/factories/test-generator-factory.js.map +1 -1
- package/dist/domains/test-generation/generators/flutter-test-generator.d.ts +107 -0
- package/dist/domains/test-generation/generators/flutter-test-generator.d.ts.map +1 -0
- package/dist/domains/test-generation/generators/flutter-test-generator.js +590 -0
- package/dist/domains/test-generation/generators/flutter-test-generator.js.map +1 -0
- package/dist/domains/test-generation/generators/go-test-generator.d.ts +139 -0
- package/dist/domains/test-generation/generators/go-test-generator.d.ts.map +1 -0
- package/dist/domains/test-generation/generators/go-test-generator.js +654 -0
- package/dist/domains/test-generation/generators/go-test-generator.js.map +1 -0
- package/dist/domains/test-generation/generators/index.d.ts +8 -0
- package/dist/domains/test-generation/generators/index.d.ts.map +1 -1
- package/dist/domains/test-generation/generators/index.js +8 -0
- package/dist/domains/test-generation/generators/index.js.map +1 -1
- package/dist/domains/test-generation/generators/jest-rn-generator.d.ts +95 -0
- package/dist/domains/test-generation/generators/jest-rn-generator.d.ts.map +1 -0
- package/dist/domains/test-generation/generators/jest-rn-generator.js +591 -0
- package/dist/domains/test-generation/generators/jest-rn-generator.js.map +1 -0
- package/dist/domains/test-generation/generators/junit5-generator.d.ts +107 -0
- package/dist/domains/test-generation/generators/junit5-generator.d.ts.map +1 -0
- package/dist/domains/test-generation/generators/junit5-generator.js +588 -0
- package/dist/domains/test-generation/generators/junit5-generator.js.map +1 -0
- package/dist/domains/test-generation/generators/kotlin-junit-generator.d.ts +109 -0
- package/dist/domains/test-generation/generators/kotlin-junit-generator.d.ts.map +1 -0
- package/dist/domains/test-generation/generators/kotlin-junit-generator.js +588 -0
- package/dist/domains/test-generation/generators/kotlin-junit-generator.js.map +1 -0
- package/dist/domains/test-generation/generators/pytest-generator.d.ts +8 -1
- package/dist/domains/test-generation/generators/pytest-generator.d.ts.map +1 -1
- package/dist/domains/test-generation/generators/pytest-generator.js +57 -0
- package/dist/domains/test-generation/generators/pytest-generator.js.map +1 -1
- package/dist/domains/test-generation/generators/rust-test-generator.d.ts +80 -0
- package/dist/domains/test-generation/generators/rust-test-generator.d.ts.map +1 -0
- package/dist/domains/test-generation/generators/rust-test-generator.js +442 -0
- package/dist/domains/test-generation/generators/rust-test-generator.js.map +1 -0
- package/dist/domains/test-generation/generators/swift-testing-generator.d.ts +97 -0
- package/dist/domains/test-generation/generators/swift-testing-generator.d.ts.map +1 -0
- package/dist/domains/test-generation/generators/swift-testing-generator.js +482 -0
- package/dist/domains/test-generation/generators/swift-testing-generator.js.map +1 -0
- package/dist/domains/test-generation/generators/xunit-generator.d.ts +110 -0
- package/dist/domains/test-generation/generators/xunit-generator.d.ts.map +1 -0
- package/dist/domains/test-generation/generators/xunit-generator.js +611 -0
- package/dist/domains/test-generation/generators/xunit-generator.js.map +1 -0
- package/dist/domains/test-generation/interfaces.d.ts +11 -2
- package/dist/domains/test-generation/interfaces.d.ts.map +1 -1
- package/dist/domains/test-generation/prompts/language-prompts.d.ts +29 -0
- package/dist/domains/test-generation/prompts/language-prompts.d.ts.map +1 -0
- package/dist/domains/test-generation/prompts/language-prompts.js +135 -0
- package/dist/domains/test-generation/prompts/language-prompts.js.map +1 -0
- package/dist/domains/test-generation/services/compilation-validator.d.ts +43 -0
- package/dist/domains/test-generation/services/compilation-validator.d.ts.map +1 -0
- package/dist/domains/test-generation/services/compilation-validator.js +134 -0
- package/dist/domains/test-generation/services/compilation-validator.js.map +1 -0
- package/dist/domains/test-generation/services/index.d.ts +2 -1
- package/dist/domains/test-generation/services/index.d.ts.map +1 -1
- package/dist/domains/test-generation/services/index.js +3 -1
- package/dist/domains/test-generation/services/index.js.map +1 -1
- package/dist/domains/test-generation/services/test-file-resolver.d.ts +32 -0
- package/dist/domains/test-generation/services/test-file-resolver.d.ts.map +1 -0
- package/dist/domains/test-generation/services/test-file-resolver.js +159 -0
- package/dist/domains/test-generation/services/test-file-resolver.js.map +1 -0
- package/dist/domains/test-generation/services/test-generator.d.ts +10 -0
- package/dist/domains/test-generation/services/test-generator.d.ts.map +1 -1
- package/dist/domains/test-generation/services/test-generator.js +87 -10
- package/dist/domains/test-generation/services/test-generator.js.map +1 -1
- package/dist/governance/feature-flags.js +2 -2
- package/dist/governance/feature-flags.js.map +1 -1
- package/dist/governance/shard-embeddings.js +1 -1
- package/dist/init/init-wizard-hooks.d.ts.map +1 -1
- package/dist/init/init-wizard-hooks.js +0 -1
- package/dist/init/init-wizard-hooks.js.map +1 -1
- package/dist/init/phases/07-hooks.d.ts.map +1 -1
- package/dist/init/phases/07-hooks.js +0 -2
- package/dist/init/phases/07-hooks.js.map +1 -1
- package/dist/init/phases/08-mcp.d.ts +8 -4
- package/dist/init/phases/08-mcp.d.ts.map +1 -1
- package/dist/init/phases/08-mcp.js +13 -31
- package/dist/init/phases/08-mcp.js.map +1 -1
- package/dist/init/phases/10-workers.js +2 -2
- package/dist/init/phases/10-workers.js.map +1 -1
- package/dist/init/settings-merge.d.ts.map +1 -1
- package/dist/init/settings-merge.js +0 -2
- package/dist/init/settings-merge.js.map +1 -1
- package/dist/init/token-bootstrap.js +1 -1
- package/dist/init/token-bootstrap.js.map +1 -1
- package/dist/integrations/rl-suite/algorithms/decision-transformer.js +1 -1
- package/dist/kernel/constants.d.ts +2 -2
- package/dist/kernel/constants.js +2 -2
- package/dist/kernel/hnsw-adapter.js +1 -1
- package/dist/kernel/progressive-hnsw-backend.d.ts +2 -2
- package/dist/kernel/progressive-hnsw-backend.js +2 -2
- package/dist/learning/dream/concept-graph.d.ts +1 -1
- package/dist/learning/dream/concept-graph.js +1 -1
- package/dist/learning/dream/dream-engine.d.ts +1 -1
- package/dist/learning/dream/dream-engine.js +1 -1
- package/dist/learning/dream/index.d.ts +1 -1
- package/dist/learning/dream/index.js +1 -1
- package/dist/learning/dream/types.d.ts +1 -1
- package/dist/learning/dream/types.d.ts.map +1 -1
- package/dist/learning/dream/types.js +1 -1
- package/dist/learning/dream/types.js.map +1 -1
- package/dist/learning/token-tracker.js +1 -1
- package/dist/learning/token-tracker.js.map +1 -1
- package/dist/mcp/bundle.js +7515 -893
- package/dist/routing/qe-agent-registry.js +4 -4
- package/dist/routing/qe-agent-registry.js.map +1 -1
- package/dist/routing/types.d.ts +5 -8
- package/dist/routing/types.d.ts.map +1 -1
- package/dist/routing/types.js.map +1 -1
- package/dist/shared/embeddings/embedding-cache.js +2 -2
- package/dist/shared/embeddings/index.d.ts +2 -2
- package/dist/shared/embeddings/index.js +2 -2
- package/dist/shared/embeddings/nomic-embedder.d.ts +4 -4
- package/dist/shared/embeddings/nomic-embedder.js +2 -2
- package/dist/shared/embeddings/ollama-client.d.ts +1 -1
- package/dist/shared/embeddings/ollama-client.js +2 -2
- package/dist/shared/embeddings/ollama-client.js.map +1 -1
- package/dist/shared/embeddings/types.d.ts +2 -2
- package/dist/shared/embeddings/types.js +2 -2
- package/dist/shared/language-detector.d.ts +46 -0
- package/dist/shared/language-detector.d.ts.map +1 -0
- package/dist/shared/language-detector.js +183 -0
- package/dist/shared/language-detector.js.map +1 -0
- package/dist/shared/llm/providers/ollama.js +1 -1
- package/dist/shared/metrics/code-metrics.d.ts.map +1 -1
- package/dist/shared/metrics/code-metrics.js +24 -1
- package/dist/shared/metrics/code-metrics.js.map +1 -1
- package/dist/shared/parsers/index.d.ts +2 -0
- package/dist/shared/parsers/index.d.ts.map +1 -1
- package/dist/shared/parsers/index.js +2 -0
- package/dist/shared/parsers/index.js.map +1 -1
- package/dist/shared/parsers/interfaces.d.ts +81 -0
- package/dist/shared/parsers/interfaces.d.ts.map +1 -0
- package/dist/shared/parsers/interfaces.js +6 -0
- package/dist/shared/parsers/interfaces.js.map +1 -0
- package/dist/shared/parsers/multi-language-parser.d.ts +144 -0
- package/dist/shared/parsers/multi-language-parser.d.ts.map +1 -0
- package/dist/shared/parsers/multi-language-parser.js +1232 -0
- package/dist/shared/parsers/multi-language-parser.js.map +1 -0
- package/dist/shared/parsers/rust-ownership-analyzer.d.ts +45 -0
- package/dist/shared/parsers/rust-ownership-analyzer.d.ts.map +1 -0
- package/dist/shared/parsers/rust-ownership-analyzer.js +52 -0
- package/dist/shared/parsers/rust-ownership-analyzer.js.map +1 -0
- package/dist/shared/parsers/typescript-parser.d.ts +16 -0
- package/dist/shared/parsers/typescript-parser.d.ts.map +1 -1
- package/dist/shared/parsers/typescript-parser.js +85 -0
- package/dist/shared/parsers/typescript-parser.js.map +1 -1
- package/dist/shared/types/test-frameworks.d.ts +25 -0
- package/dist/shared/types/test-frameworks.d.ts.map +1 -0
- package/dist/shared/types/test-frameworks.js +111 -0
- package/dist/shared/types/test-frameworks.js.map +1 -0
- package/package.json +1 -1
- package/scripts/prepare-assets.sh +8 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/domains/test-generation/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAM9D,MAAM,WAAW,kBAAkB;IACjC,sCAAsC;IACtC,aAAa,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC,CAAC;IAEvF,wCAAwC;IACxC,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC;IAE3E,oCAAoC;IACpC,qBAAqB,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC,CAAC;IAE7F,yBAAyB;IACzB,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC;IAE/E,yCAAyC;IACzC,aAAa,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC,CAAC;CACzF;AAMD,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,EAAE,MAAM,GAAG,aAAa,GAAG,KAAK,CAAC;IACzC,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/domains/test-generation/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAM9D,MAAM,WAAW,kBAAkB;IACjC,sCAAsC;IACtC,aAAa,CAAC,OAAO,EAAE,qBA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
|
5
|
+
import type { SupportedLanguage } from '../../../shared/types/test-frameworks.js';
|
|
6
|
+
/**
|
|
7
|
+
* Language-specific prompt configuration
|
|
8
|
+
*/
|
|
9
|
+
export interface LanguagePromptConfig {
|
|
10
|
+
/** System context describing the language ecosystem */
|
|
11
|
+
systemContext: string;
|
|
12
|
+
/** Coding conventions for this language */
|
|
13
|
+
conventions: string[];
|
|
14
|
+
/** Preferred assertion style */
|
|
15
|
+
assertionStyle: string;
|
|
16
|
+
/** Preferred mocking approach */
|
|
17
|
+
mockingStyle: string;
|
|
18
|
+
/** Code fence language identifier */
|
|
19
|
+
codeFenceLanguage: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Per-language prompt configurations
|
|
23
|
+
*/
|
|
24
|
+
export declare const LANGUAGE_PROMPTS: Record<SupportedLanguage, LanguagePromptConfig>;
|
|
25
|
+
/**
|
|
26
|
+
* Get the prompt configuration for a language
|
|
27
|
+
*/
|
|
28
|
+
export declare function getPromptConfig(language: SupportedLanguage): LanguagePromptConfig;
|
|
29
|
+
//# sourceMappingURL=language-prompts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"language-prompts.d.ts","sourceRoot":"","sources":["../../../../src/domains/test-generation/prompts/language-prompts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAElF;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,uDAAuD;IACvD,aAAa,EAAE,MAAM,CAAC;IACtB,2CAA2C;IAC3C,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,gCAAgC;IAChC,cAAc,EAAE,MAAM,CAAC;IACvB,iCAAiC;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,qCAAqC;IACrC,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAiI5E,CAAC;AAEF;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,iBAAiB,GAAG,oBAAoB,CAEjF"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Language-Aware LLM Prompts (M1.10)
|
|
3
|
+
* Per-language prompt configurations for LLM-enhanced test generation.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Per-language prompt configurations
|
|
7
|
+
*/
|
|
8
|
+
export const LANGUAGE_PROMPTS = {
|
|
9
|
+
typescript: {
|
|
10
|
+
systemContext: 'TypeScript with strict typing, ESM modules, and modern ES2022+ features.',
|
|
11
|
+
conventions: [
|
|
12
|
+
'Use strict TypeScript types — avoid `any`',
|
|
13
|
+
'Use `import type` for type-only imports',
|
|
14
|
+
'Prefer `const` assertions and branded types',
|
|
15
|
+
'Use async/await over raw Promises',
|
|
16
|
+
],
|
|
17
|
+
assertionStyle: 'expect(value).toBe(expected) — Vitest/Jest matchers',
|
|
18
|
+
mockingStyle: 'vi.mock() / jest.mock() with typed mocks',
|
|
19
|
+
codeFenceLanguage: 'typescript',
|
|
20
|
+
},
|
|
21
|
+
javascript: {
|
|
22
|
+
systemContext: 'JavaScript with ES2022+ features, CommonJS or ESM modules.',
|
|
23
|
+
conventions: [
|
|
24
|
+
'Use const/let, never var',
|
|
25
|
+
'Use arrow functions for callbacks',
|
|
26
|
+
'Prefer template literals for string interpolation',
|
|
27
|
+
],
|
|
28
|
+
assertionStyle: 'expect(value).toBe(expected) — Jest matchers',
|
|
29
|
+
mockingStyle: 'jest.mock() with manual mock implementations',
|
|
30
|
+
codeFenceLanguage: 'javascript',
|
|
31
|
+
},
|
|
32
|
+
python: {
|
|
33
|
+
systemContext: 'Python 3.10+ with type hints, dataclasses, and async support.',
|
|
34
|
+
conventions: [
|
|
35
|
+
'Follow PEP 8 naming (snake_case for functions, PascalCase for classes)',
|
|
36
|
+
'Use type hints on all function signatures',
|
|
37
|
+
'Use `pytest` fixtures for setup/teardown',
|
|
38
|
+
'Use `@pytest.mark.asyncio` for async tests',
|
|
39
|
+
],
|
|
40
|
+
assertionStyle: 'assert value == expected — plain assert with pytest',
|
|
41
|
+
mockingStyle: 'unittest.mock.patch / pytest-mock fixtures',
|
|
42
|
+
codeFenceLanguage: 'python',
|
|
43
|
+
},
|
|
44
|
+
java: {
|
|
45
|
+
systemContext: 'Java 17+ with records, sealed classes, and pattern matching.',
|
|
46
|
+
conventions: [
|
|
47
|
+
'Use JUnit 5 @Test and @DisplayName annotations',
|
|
48
|
+
'Use AssertJ fluent assertions (assertThat)',
|
|
49
|
+
'Follow given-when-then structure in test methods',
|
|
50
|
+
'Use @ExtendWith(MockitoExtension.class) for dependency injection',
|
|
51
|
+
],
|
|
52
|
+
assertionStyle: 'assertThat(value).isEqualTo(expected) — AssertJ',
|
|
53
|
+
mockingStyle: 'Mockito @Mock, @InjectMocks, when().thenReturn()',
|
|
54
|
+
codeFenceLanguage: 'java',
|
|
55
|
+
},
|
|
56
|
+
csharp: {
|
|
57
|
+
systemContext: 'C# 11+ with nullable reference types, records, and async streams.',
|
|
58
|
+
conventions: [
|
|
59
|
+
'Use xUnit [Fact] and [Theory] attributes',
|
|
60
|
+
'Use FluentAssertions for readable assertions',
|
|
61
|
+
'Follow Arrange-Act-Assert pattern',
|
|
62
|
+
'Use Moq for interface mocking',
|
|
63
|
+
],
|
|
64
|
+
assertionStyle: 'value.Should().Be(expected) — FluentAssertions',
|
|
65
|
+
mockingStyle: 'new Mock<IService>().Setup(x => x.Method()).Returns(value)',
|
|
66
|
+
codeFenceLanguage: 'csharp',
|
|
67
|
+
},
|
|
68
|
+
go: {
|
|
69
|
+
systemContext: 'Go 1.21+ with generics, error wrapping, and context propagation.',
|
|
70
|
+
conventions: [
|
|
71
|
+
'Use table-driven tests with t.Run subtests',
|
|
72
|
+
'Always check both value and error returns',
|
|
73
|
+
'Use testify/assert for assertions (or standard testing)',
|
|
74
|
+
'Mock interfaces with struct implementations',
|
|
75
|
+
],
|
|
76
|
+
assertionStyle: 'assert.Equal(t, expected, actual) — testify',
|
|
77
|
+
mockingStyle: 'Interface-based mock structs',
|
|
78
|
+
codeFenceLanguage: 'go',
|
|
79
|
+
},
|
|
80
|
+
rust: {
|
|
81
|
+
systemContext: 'Rust with ownership, borrowing, lifetimes, and trait-based generics.',
|
|
82
|
+
conventions: [
|
|
83
|
+
'Place tests in #[cfg(test)] mod tests { use super::*; }',
|
|
84
|
+
'Use assert!, assert_eq!, assert_ne! macros',
|
|
85
|
+
'Use #[should_panic(expected = "...")] for panic tests',
|
|
86
|
+
'Use #[tokio::test] for async tests',
|
|
87
|
+
],
|
|
88
|
+
assertionStyle: 'assert_eq!(value, expected) — standard macros',
|
|
89
|
+
mockingStyle: 'mockall crate with #[automock] on traits',
|
|
90
|
+
codeFenceLanguage: 'rust',
|
|
91
|
+
},
|
|
92
|
+
swift: {
|
|
93
|
+
systemContext: 'Swift 5.10+ with Swift Testing framework, actors, and structured concurrency.',
|
|
94
|
+
conventions: [
|
|
95
|
+
'Use @Test attribute with description strings',
|
|
96
|
+
'Use #expect() macro for assertions',
|
|
97
|
+
'Use @Suite for grouping related tests',
|
|
98
|
+
'Protocol-based mocking (manual stubs)',
|
|
99
|
+
],
|
|
100
|
+
assertionStyle: '#expect(value == expected) — Swift Testing macros',
|
|
101
|
+
mockingStyle: 'Protocol conformance with manual mock implementations',
|
|
102
|
+
codeFenceLanguage: 'swift',
|
|
103
|
+
},
|
|
104
|
+
kotlin: {
|
|
105
|
+
systemContext: 'Kotlin with coroutines, null safety, extension functions, and sealed classes.',
|
|
106
|
+
conventions: [
|
|
107
|
+
'Use backtick test names: `should return user when id is valid`',
|
|
108
|
+
'Use MockK @MockK and coEvery for coroutine mocking',
|
|
109
|
+
'Use runTest { } for coroutine test wrappers',
|
|
110
|
+
'Use Turbine for Flow testing',
|
|
111
|
+
],
|
|
112
|
+
assertionStyle: 'value shouldBe expected — Kotest matchers or JUnit assertEquals',
|
|
113
|
+
mockingStyle: 'MockK coEvery { service.call() } returns result',
|
|
114
|
+
codeFenceLanguage: 'kotlin',
|
|
115
|
+
},
|
|
116
|
+
dart: {
|
|
117
|
+
systemContext: 'Dart 3+ with null safety, records, and sealed classes. Flutter widgets.',
|
|
118
|
+
conventions: [
|
|
119
|
+
'Use test() for unit tests, testWidgets() for widget tests',
|
|
120
|
+
'Use group() for test organization',
|
|
121
|
+
'Use @GenerateMocks for mockito code generation',
|
|
122
|
+
'Route Widget subclasses to testWidgets with pumpWidget',
|
|
123
|
+
],
|
|
124
|
+
assertionStyle: 'expect(value, equals(expected)) — matcher-based',
|
|
125
|
+
mockingStyle: '@GenerateMocks([ServiceClass]) + when(mock.method()).thenReturn(value)',
|
|
126
|
+
codeFenceLanguage: 'dart',
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* Get the prompt configuration for a language
|
|
131
|
+
*/
|
|
132
|
+
export function getPromptConfig(language) {
|
|
133
|
+
return LANGUAGE_PROMPTS[language];
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=language-prompts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"language-prompts.js","sourceRoot":"","sources":["../../../../src/domains/test-generation/prompts/language-prompts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAoBH;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAoD;IAC/E,UAAU,EAAE;QACV,aAAa,EAAE,0EAA0E;QACzF,WAAW,EAAE;YACX,2CAA2C;YAC3C,yCAAyC;YACzC,6CAA6C;YAC7C,mCAAmC;SACpC;QACD,cAAc,EAAE,qDAAqD;QACrE,YAAY,EAAE,0CAA0C;QACxD,iBAAiB,EAAE,YAAY;KAChC;IAED,UAAU,EAAE;QACV,aAAa,EAAE,4DAA4D;QAC3E,WAAW,EAAE;YACX,0BAA0B;YAC1B,mCAAmC;YACnC,mDAAmD;SACpD;QACD,cAAc,EAAE,8CAA8C;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ACvC,uCAAuC;SACxC;QACD,cAAc,EAAE,mDAAmD;QACnE,YAAY,EAAE,uDAAuD;QACrE,iBAAiB,EAAE,OAAO;KAC3B;IAED,MAAM,EAAE;QACN,aAAa,EAAE,+EAA+E;QAC9F,WAAW,EAAE;YACX,gEAAgE;YAChE,oDAAoD;YACpD,6CAA6C;YAC7C,8BAA8B;SAC/B;QACD,cAAc,EAAE,iEAAiE;QACjF,YAAY,EAAE,iDAAiD;QAC/D,iBAAiB,EAAE,QAAQ;KAC5B;IAED,IAAI,EAAE;QACJ,aAAa,EAAE,yEAAyE;QACxF,WAAW,EAAE;YACX,2DAA2D;YAC3D,mCAAmC;YACnC,gDAAgD;YAChD,wDAAwD;SACzD;QACD,cAAc,EAAE,iDAAiD;QACjE,YAAY,EAAE,wEAAwE;QACtF,iBAAiB,EAAE,MAAM;KAC1B;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,QAA2B;IACzD,OAAO,gBAAgB,CAAC,QAAQ,CAAC,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compilation Validation Loop (ADR-077)
|
|
3
|
+
* Optional compile-check for generated tests with graceful fallback.
|
|
4
|
+
*/
|
|
5
|
+
import type { SupportedLanguage } from '../../../shared/types/test-frameworks.js';
|
|
6
|
+
/**
|
|
7
|
+
* Compilation error details
|
|
8
|
+
*/
|
|
9
|
+
export interface CompilationError {
|
|
10
|
+
message: string;
|
|
11
|
+
line?: number;
|
|
12
|
+
column?: number;
|
|
13
|
+
file?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Result of compilation validation
|
|
17
|
+
*/
|
|
18
|
+
export interface ValidationResult {
|
|
19
|
+
compiles: boolean;
|
|
20
|
+
errors: CompilationError[];
|
|
21
|
+
suggestions: string[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Compilation validator interface
|
|
25
|
+
*/
|
|
26
|
+
export interface ICompilationValidator {
|
|
27
|
+
validate(code: string, language: SupportedLanguage, projectPath?: string): Promise<ValidationResult>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Compilation validator with per-language support.
|
|
31
|
+
* Writes generated test code to a temp file, runs the language's compile/check
|
|
32
|
+
* command, and parses any errors into structured results with suggestions.
|
|
33
|
+
*/
|
|
34
|
+
export declare class CompilationValidator implements ICompilationValidator {
|
|
35
|
+
validate(code: string, language: SupportedLanguage, projectPath?: string): Promise<ValidationResult>;
|
|
36
|
+
private isCommandNotFound;
|
|
37
|
+
private getStderr;
|
|
38
|
+
private parseErrors;
|
|
39
|
+
private generateSuggestions;
|
|
40
|
+
}
|
|
41
|
+
/** Singleton instance */
|
|
42
|
+
export declare const compilationValidator: CompilationValidator;
|
|
43
|
+
//# sourceMappingURL=compilation-validator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compilation-validator.d.ts","sourceRoot":"","sources":["../../../../src/domains/test-generation/services/compilation-validator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAElF;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CACtG;AAcD;;;;GAIG;AACH,qBAAa,oBAAqB,YAAW,qBAAqB;IAC1D,QAAQ,CACZ,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,iBAAiB,EAC3B,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,gBAAgB,CAAC;IA+D5B,OAAO,CAAC,iBAAiB;IAKzB,OAAO,CAAC,SAAS;IAOjB,OAAO,CAAC,WAAW;IAuBnB,OAAO,CAAC,mBAAmB;CAkB5B;AAED,yBAAyB;AACzB,eAAO,MAAM,oBAAoB,sBAA6B,CAAC"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compilation Validation Loop (ADR-077)
|
|
3
|
+
* Optional compile-check for generated tests with graceful fallback.
|
|
4
|
+
*/
|
|
5
|
+
import { execSync } from 'child_process';
|
|
6
|
+
import * as fs from 'fs';
|
|
7
|
+
import * as path from 'path';
|
|
8
|
+
import * as os from 'os';
|
|
9
|
+
// Per-language compile commands
|
|
10
|
+
const COMPILE_COMMANDS = {
|
|
11
|
+
typescript: { check: 'npx tsc --noEmit --strict', fileExt: '.ts' },
|
|
12
|
+
java: { check: 'javac -d /dev/null', fileExt: '.java' },
|
|
13
|
+
csharp: { check: 'dotnet build --no-restore', fileExt: '.cs' },
|
|
14
|
+
go: { check: 'go vet', fileExt: '_test.go' },
|
|
15
|
+
rust: { check: 'cargo check', fileExt: '.rs' },
|
|
16
|
+
kotlin: { check: 'kotlinc -script', fileExt: '.kts' },
|
|
17
|
+
swift: { check: 'swiftc -typecheck', fileExt: '.swift' },
|
|
18
|
+
dart: { check: 'dart analyze', fileExt: '.dart' },
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Compilation validator with per-language support.
|
|
22
|
+
* Writes generated test code to a temp file, runs the language's compile/check
|
|
23
|
+
* command, and parses any errors into structured results with suggestions.
|
|
24
|
+
*/
|
|
25
|
+
export class CompilationValidator {
|
|
26
|
+
async validate(code, language, projectPath) {
|
|
27
|
+
const config = COMPILE_COMMANDS[language];
|
|
28
|
+
// Languages without compile check (Python, JavaScript)
|
|
29
|
+
if (!config) {
|
|
30
|
+
return {
|
|
31
|
+
compiles: true,
|
|
32
|
+
errors: [],
|
|
33
|
+
suggestions: [`No compilation check available for ${language} -- syntax validation skipped`],
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
// Write code to temp file
|
|
37
|
+
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'aqe-compile-'));
|
|
38
|
+
const tmpFile = path.join(tmpDir, `test_validation${config.fileExt}`);
|
|
39
|
+
try {
|
|
40
|
+
fs.writeFileSync(tmpFile, code, 'utf-8');
|
|
41
|
+
const cmd = `${config.check} ${tmpFile}`;
|
|
42
|
+
const cwd = projectPath || tmpDir;
|
|
43
|
+
execSync(cmd, {
|
|
44
|
+
cwd,
|
|
45
|
+
timeout: 30000,
|
|
46
|
+
stdio: 'pipe',
|
|
47
|
+
encoding: 'utf-8',
|
|
48
|
+
});
|
|
49
|
+
return {
|
|
50
|
+
compiles: true,
|
|
51
|
+
errors: [],
|
|
52
|
+
suggestions: [],
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
// Compiler not found
|
|
57
|
+
if (this.isCommandNotFound(error)) {
|
|
58
|
+
return {
|
|
59
|
+
compiles: false,
|
|
60
|
+
errors: [{ message: `Compiler not found for ${language}` }],
|
|
61
|
+
suggestions: [`Install the ${language} compiler to enable compilation validation`],
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
// Compilation failed
|
|
65
|
+
const stderr = this.getStderr(error);
|
|
66
|
+
const errors = this.parseErrors(stderr, language);
|
|
67
|
+
return {
|
|
68
|
+
compiles: false,
|
|
69
|
+
errors: errors.length > 0 ? errors : [{ message: stderr || 'Compilation failed' }],
|
|
70
|
+
suggestions: this.generateSuggestions(errors, language),
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
finally {
|
|
74
|
+
// Cleanup
|
|
75
|
+
try {
|
|
76
|
+
fs.unlinkSync(tmpFile);
|
|
77
|
+
fs.rmdirSync(tmpDir);
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
/* ignore cleanup errors */
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
isCommandNotFound(error) {
|
|
85
|
+
const msg = String(error);
|
|
86
|
+
return msg.includes('ENOENT') || msg.includes('not found') || msg.includes('command not found');
|
|
87
|
+
}
|
|
88
|
+
getStderr(error) {
|
|
89
|
+
if (error && typeof error === 'object' && 'stderr' in error) {
|
|
90
|
+
return String(error.stderr);
|
|
91
|
+
}
|
|
92
|
+
return String(error);
|
|
93
|
+
}
|
|
94
|
+
parseErrors(stderr, _language) {
|
|
95
|
+
if (!stderr)
|
|
96
|
+
return [];
|
|
97
|
+
const errors = [];
|
|
98
|
+
const lines = stderr.split('\n').filter((l) => l.trim());
|
|
99
|
+
for (const line of lines.slice(0, 10)) {
|
|
100
|
+
// Try to parse line:col format (common across compilers)
|
|
101
|
+
const match = line.match(/(?:.*?):(\d+):(\d+):\s*(?:error:\s*)?(.*)/);
|
|
102
|
+
if (match) {
|
|
103
|
+
errors.push({
|
|
104
|
+
message: match[3].trim(),
|
|
105
|
+
line: parseInt(match[1], 10),
|
|
106
|
+
column: parseInt(match[2], 10),
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
else if (line.includes('error') || line.includes('Error')) {
|
|
110
|
+
errors.push({ message: line.trim() });
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return errors;
|
|
114
|
+
}
|
|
115
|
+
generateSuggestions(errors, _language) {
|
|
116
|
+
const suggestions = [];
|
|
117
|
+
for (const error of errors) {
|
|
118
|
+
const msg = error.message.toLowerCase();
|
|
119
|
+
if (msg.includes('import') || msg.includes('module')) {
|
|
120
|
+
suggestions.push('Check import statements -- ensure all dependencies are available');
|
|
121
|
+
}
|
|
122
|
+
if (msg.includes('type') || msg.includes('cannot find')) {
|
|
123
|
+
suggestions.push('Verify type definitions match the source code signatures');
|
|
124
|
+
}
|
|
125
|
+
if (msg.includes('undefined') || msg.includes('undeclared')) {
|
|
126
|
+
suggestions.push('Ensure all referenced symbols are properly imported or declared');
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return [...new Set(suggestions)]; // Dedupe
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
/** Singleton instance */
|
|
133
|
+
export const compilationValidator = new CompilationValidator();
|
|
134
|
+
//# sourceMappingURL=compilation-validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compilation-validator.js","sourceRoot":"","sources":["../../../../src/domains/test-generation/services/compilation-validator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AA6BzB,gCAAgC;AAChC,MAAM,gBAAgB,GAA2E;IAC/F,UAAU,EAAE,EAAE,KAAK,EAAE,2BAA2B,EAAE,OAAO,EAAE,KAAK,EAAE;IAClE,IAAI,EAAE,EAAE,KAAK,EAAE,oBAAoB,EAAE,OAAO,EAAE,OAAO,EAAE;IACvD,MAAM,EAAE,EAAE,KAAK,EAAE,2BAA2B,EAAE,OAAO,EAAE,KAAK,EAAE;IAC9D,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE;IAC5C,IAAI,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,KAAK,EAAE;IAC9C,MAAM,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,EAAE;IACrD,KAAK,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE,OAAO,EAAE,QAAQ,EAAE;IACx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AC;YAC3B,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;YACxC,IAAI,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;gBACrD,WAAW,CAAC,IAAI,CAAC,kEAAkE,CAAC,CAAC;YACvF,CAAC;YACD,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;gBACxD,WAAW,CAAC,IAAI,CAAC,0DAA0D,CAAC,CAAC;YAC/E,CAAC;YACD,IAAI,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;gBAC5D,WAAW,CAAC,IAAI,CAAC,iEAAiE,CAAC,CAAC;YACtF,CAAC;QACH,CAAC;QAED,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS;IAC7C,CAAC;CACF;AAED,yBAAyB;AACzB,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,oBAAoB,EAAE,CAAC"}
|
|
@@ -8,8 +8,9 @@ export { PropertyTestGeneratorService, type IPropertyTestGeneratorService, } fro
|
|
|
8
8
|
export { TestDataGeneratorService, type ITestDataGeneratorService, } from './test-data-generator';
|
|
9
9
|
export { PatternMatcherService, type IPatternMatchingService, type PatternMatcherConfig, type PatternSearchContext, type PatternMatch, type AppliedPattern, type PatternModification, type PatternDefinition, type PatternExample, type PatternFilter, } from './pattern-matcher';
|
|
10
10
|
export { CodeTransformService, createCodeTransformService, quickTransformTestCode, isEligibleForTransform, detectEligibleTransforms, DEFAULT_TRANSFORM_CONFIG, type CodeTransformConfig, type CodeTransformResult, } from './code-transform-integration';
|
|
11
|
+
export { CompilationValidator, compilationValidator, type ICompilationValidator, type CompilationError, type ValidationResult, } from './compilation-validator';
|
|
11
12
|
export { TestGenerationCoherenceGate, createTestGenerationCoherenceGate, CoherenceError, DEFAULT_COHERENCE_GATE_CONFIG, type Requirement, type TestSpecification, type EnrichmentRecommendation, type RequirementCoherenceResult, type RequirementContradiction, type ContradictionSeverity, type TestGenerationCoherenceGateConfig, type IEmbeddingService, } from './coherence-gate-service';
|
|
12
13
|
export { type ITestGenerator, type ITestGeneratorFactory, type TestFramework, type TestType, type FunctionInfo, type ClassInfo, type ParameterInfo, type PropertyInfo, type TestCase, type CodeAnalysis, type TestGenerationContext, type Pattern as GeneratorPattern, } from '../interfaces';
|
|
13
|
-
export { BaseTestGenerator, JestVitestGenerator, MochaGenerator, PytestGenerator, } from '../generators';
|
|
14
|
+
export { BaseTestGenerator, JestVitestGenerator, MochaGenerator, PytestGenerator, NodeTestGenerator, JUnit5Generator, XUnitGenerator, GoTestGenerator, RustTestGenerator, SwiftTestingGenerator, KotlinJUnitGenerator, FlutterTestGenerator, JestRNGenerator, } from '../generators';
|
|
14
15
|
export { TestGeneratorFactory, testGeneratorFactory, createTestGenerator, isValidTestFramework, } from '../factories';
|
|
15
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/domains/test-generation/services/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,0CAA0C,EAC1C,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,GAC/B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,mBAAmB,EACnB,KAAK,oBAAoB,GAC1B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,4BAA4B,EAC5B,KAAK,6BAA6B,GACnC,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,wBAAwB,EACxB,KAAK,yBAAyB,GAC/B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,qBAAqB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,aAAa,GACnB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,wBAAwB,EACxB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,GACzB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EACL,2BAA2B,EAC3B,iCAAiC,EACjC,cAAc,EACd,6BAA6B,EAC7B,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,iCAAiC,EACtC,KAAK,iBAAiB,GACvB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,OAAO,IAAI,gBAAgB,GACjC,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,eAAe,GAChB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/domains/test-generation/services/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,oBAAoB,E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YAAY,EACjB,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,OAAO,IAAI,gBAAgB,GACjC,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,GAChB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,cAAc,CAAC"}
|
|
@@ -9,10 +9,12 @@ export { TestDataGeneratorService, } from './test-data-generator';
|
|
|
9
9
|
export { PatternMatcherService, } from './pattern-matcher';
|
|
10
10
|
// Agent Booster Integration (ADR-051)
|
|
11
11
|
export { CodeTransformService, createCodeTransformService, quickTransformTestCode, isEligibleForTransform, detectEligibleTransforms, DEFAULT_TRANSFORM_CONFIG, } from './code-transform-integration';
|
|
12
|
+
// Compilation Validation Loop (ADR-077)
|
|
13
|
+
export { CompilationValidator, compilationValidator, } from './compilation-validator';
|
|
12
14
|
// Coherence Gate Service (ADR-052)
|
|
13
15
|
export { TestGenerationCoherenceGate, createTestGenerationCoherenceGate, CoherenceError, DEFAULT_COHERENCE_GATE_CONFIG, } from './coherence-gate-service';
|
|
14
16
|
// Generator implementations
|
|
15
|
-
export { BaseTestGenerator, JestVitestGenerator, MochaGenerator, PytestGenerator, } from '../generators';
|
|
17
|
+
export { BaseTestGenerator, JestVitestGenerator, MochaGenerator, PytestGenerator, NodeTestGenerator, JUnit5Generator, XUnitGenerator, GoTestGenerator, RustTestGenerator, SwiftTestingGenerator, KotlinJUnitGenerator, FlutterTestGenerator, JestRNGenerator, } from '../generators';
|
|
16
18
|
// Factory
|
|
17
19
|
export { TestGeneratorFactory, testGeneratorFactory, createTestGenerator, isValidTestFramework, } from '../factories';
|
|
18
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/domains/test-generation/services/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,0CAA0C,GAI3C,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,mBAAmB,GAEpB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,4BAA4B,GAE7B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,wBAAwB,GAEzB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,qBAAqB,GAUtB,MAAM,mBAAmB,CAAC;AAE3B,sCAAsC;AACtC,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,wBAAwB,GAGzB,MAAM,8BAA8B,CAAC;AAEtC,mCAAmC;AACnC,OAAO,EACL,2BAA2B,EAC3B,iCAAiC,EACjC,cAAc,EACd,6BAA6B,GAS9B,MAAM,0BAA0B,CAAC;AAmBlC,4BAA4B;AAC5B,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,eAAe,GAChB,MAAM,eAAe,CAAC;AAEvB,UAAU;AACV,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/domains/test-generation/services/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,0CAA0C,GAI3C,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,mBAAmB,GAEpB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,4BAA4B,GAE7B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,wBAAwB,GAEzB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,qBAAqB,GAUtB,MAAM,mBAAmB,CAAC;AAE3B,sCAAsC;AACtC,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,wBAAwB,GAGzB,MAAM,8BAA8B,CAAC;AAEtC,wCAAwC;AACxC,OAAO,EACL,oBAAoB,EACpB,oBAAoB,GAIrB,MAAM,yBAAyB,CAAC;AAEjC,mCAAmC;AACnC,OAAO,EACL,2BAA2B,EAC3B,iCAAiC,EACjC,cAAc,EACd,6BAA6B,GAS9B,MAAM,0BAA0B,CAAC;AAmBlC,4BAA4B;AAC5B,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,GAChB,MAAM,eAAe,CAAC;AAEvB,UAAU;AACV,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test File Path Resolver (ADR-079)
|
|
3
|
+
* Resolves correct test file output paths per language convention.
|
|
4
|
+
*/
|
|
5
|
+
import type { SupportedLanguage } from '../../../shared/types/test-frameworks.js';
|
|
6
|
+
/**
|
|
7
|
+
* Test file placement strategy
|
|
8
|
+
*/
|
|
9
|
+
export type TestPlacementStrategy = 'alongside' | 'tests-directory' | 'maven-mirror' | 'test-project' | 'inline';
|
|
10
|
+
/**
|
|
11
|
+
* Test file convention for a language
|
|
12
|
+
*/
|
|
13
|
+
export interface TestFileConvention {
|
|
14
|
+
strategy: TestPlacementStrategy;
|
|
15
|
+
testPrefix: string;
|
|
16
|
+
testSuffix: string;
|
|
17
|
+
testExtension: string;
|
|
18
|
+
testDirectory?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Per-language test file conventions
|
|
22
|
+
*/
|
|
23
|
+
export declare const TEST_FILE_CONVENTIONS: Record<SupportedLanguage, TestFileConvention>;
|
|
24
|
+
/**
|
|
25
|
+
* Resolve the test file path for a given source file
|
|
26
|
+
*/
|
|
27
|
+
export declare function resolveTestFilePath(sourceFile: string, language: SupportedLanguage, projectRoot?: string): string;
|
|
28
|
+
/**
|
|
29
|
+
* Get the test file convention for a language
|
|
30
|
+
*/
|
|
31
|
+
export declare function getTestFileConvention(language: SupportedLanguage): TestFileConvention;
|
|
32
|
+
//# sourceMappingURL=test-file-resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-file-resolver.d.ts","sourceRoot":"","sources":["../../../../src/domains/test-generation/services/test-file-resolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAElF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAC7B,WAAW,GACX,iBAAiB,GACjB,cAAc,GACd,cAAc,GACd,QAAQ,CAAC;AAEb;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,qBAAqB,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,iBAAiB,EAAE,kBAAkB,CAmE/E,CAAC;AAEF;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,iBAAiB,EAC3B,WAAW,CAAC,EAAE,MAAM,GACnB,MAAM,CAmFR;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,kBAAkB,CAErF"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test File Path Resolver (ADR-079)
|
|
3
|
+
* Resolves correct test file output paths per language convention.
|
|
4
|
+
*/
|
|
5
|
+
import * as path from 'path';
|
|
6
|
+
/**
|
|
7
|
+
* Per-language test file conventions
|
|
8
|
+
*/
|
|
9
|
+
export const TEST_FILE_CONVENTIONS = {
|
|
10
|
+
typescript: {
|
|
11
|
+
strategy: 'alongside',
|
|
12
|
+
testPrefix: '',
|
|
13
|
+
testSuffix: '.test',
|
|
14
|
+
testExtension: '.ts',
|
|
15
|
+
},
|
|
16
|
+
javascript: {
|
|
17
|
+
strategy: 'alongside',
|
|
18
|
+
testPrefix: '',
|
|
19
|
+
testSuffix: '.test',
|
|
20
|
+
testExtension: '.js',
|
|
21
|
+
},
|
|
22
|
+
python: {
|
|
23
|
+
strategy: 'tests-directory',
|
|
24
|
+
testPrefix: 'test_',
|
|
25
|
+
testSuffix: '',
|
|
26
|
+
testExtension: '.py',
|
|
27
|
+
testDirectory: 'tests',
|
|
28
|
+
},
|
|
29
|
+
java: {
|
|
30
|
+
strategy: 'maven-mirror',
|
|
31
|
+
testPrefix: '',
|
|
32
|
+
testSuffix: 'Test',
|
|
33
|
+
testExtension: '.java',
|
|
34
|
+
testDirectory: 'src/test/java',
|
|
35
|
+
},
|
|
36
|
+
csharp: {
|
|
37
|
+
strategy: 'test-project',
|
|
38
|
+
testPrefix: '',
|
|
39
|
+
testSuffix: 'Tests',
|
|
40
|
+
testExtension: '.cs',
|
|
41
|
+
testDirectory: 'tests',
|
|
42
|
+
},
|
|
43
|
+
go: {
|
|
44
|
+
strategy: 'alongside',
|
|
45
|
+
testPrefix: '',
|
|
46
|
+
testSuffix: '_test',
|
|
47
|
+
testExtension: '.go',
|
|
48
|
+
},
|
|
49
|
+
rust: {
|
|
50
|
+
strategy: 'inline',
|
|
51
|
+
testPrefix: '',
|
|
52
|
+
testSuffix: '',
|
|
53
|
+
testExtension: '.rs',
|
|
54
|
+
},
|
|
55
|
+
swift: {
|
|
56
|
+
strategy: 'tests-directory',
|
|
57
|
+
testPrefix: '',
|
|
58
|
+
testSuffix: 'Tests',
|
|
59
|
+
testExtension: '.swift',
|
|
60
|
+
testDirectory: 'Tests',
|
|
61
|
+
},
|
|
62
|
+
kotlin: {
|
|
63
|
+
strategy: 'maven-mirror',
|
|
64
|
+
testPrefix: '',
|
|
65
|
+
testSuffix: 'Test',
|
|
66
|
+
testExtension: '.kt',
|
|
67
|
+
testDirectory: 'src/test/kotlin',
|
|
68
|
+
},
|
|
69
|
+
dart: {
|
|
70
|
+
strategy: 'tests-directory',
|
|
71
|
+
testPrefix: '',
|
|
72
|
+
testSuffix: '_test',
|
|
73
|
+
testExtension: '.dart',
|
|
74
|
+
testDirectory: 'test',
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Resolve the test file path for a given source file
|
|
79
|
+
*/
|
|
80
|
+
export function resolveTestFilePath(sourceFile, language, projectRoot) {
|
|
81
|
+
const convention = TEST_FILE_CONVENTIONS[language];
|
|
82
|
+
const parsed = path.parse(sourceFile);
|
|
83
|
+
const baseName = parsed.name;
|
|
84
|
+
const dir = parsed.dir;
|
|
85
|
+
switch (convention.strategy) {
|
|
86
|
+
case 'alongside': {
|
|
87
|
+
// Test file next to source: foo.ts -> foo.test.ts, foo.go -> foo_test.go
|
|
88
|
+
const testName = `${convention.testPrefix}${baseName}${convention.testSuffix}${convention.testExtension}`;
|
|
89
|
+
return path.join(dir, testName);
|
|
90
|
+
}
|
|
91
|
+
case 'tests-directory': {
|
|
92
|
+
// Mirror in tests/ directory: src/utils.py -> tests/test_utils.py
|
|
93
|
+
const testDir = convention.testDirectory || 'tests';
|
|
94
|
+
const root = projectRoot || '.';
|
|
95
|
+
// Try to make path relative to project root
|
|
96
|
+
let relativePath;
|
|
97
|
+
try {
|
|
98
|
+
relativePath = path.relative(root, dir);
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
relativePath = dir;
|
|
102
|
+
}
|
|
103
|
+
// Remove common source directories from relative path
|
|
104
|
+
const cleanPath = relativePath
|
|
105
|
+
.replace(/^src[\/\\]?/, '')
|
|
106
|
+
.replace(/^lib[\/\\]?/, '')
|
|
107
|
+
.replace(/^Sources[\/\\]?/, '');
|
|
108
|
+
const testName = `${convention.testPrefix}${baseName}${convention.testSuffix}${convention.testExtension}`;
|
|
109
|
+
return path.join(root, testDir, cleanPath, testName);
|
|
110
|
+
}
|
|
111
|
+
case 'maven-mirror': {
|
|
112
|
+
// Maven convention: src/main/java/com/foo/Bar.java -> src/test/java/com/foo/BarTest.java
|
|
113
|
+
const root = projectRoot || '.';
|
|
114
|
+
const testDir = convention.testDirectory || 'src/test/java';
|
|
115
|
+
let relativePath;
|
|
116
|
+
try {
|
|
117
|
+
relativePath = path.relative(root, sourceFile);
|
|
118
|
+
}
|
|
119
|
+
catch {
|
|
120
|
+
relativePath = sourceFile;
|
|
121
|
+
}
|
|
122
|
+
// Replace src/main/java with src/test/java (or src/main/kotlin with src/test/kotlin)
|
|
123
|
+
const testPath = relativePath
|
|
124
|
+
.replace(/^src[\/\\]main[\/\\]java[\/\\]?/, `${testDir}${path.sep}`)
|
|
125
|
+
.replace(/^src[\/\\]main[\/\\]kotlin[\/\\]?/, `${testDir}${path.sep}`);
|
|
126
|
+
const testParsed = path.parse(testPath);
|
|
127
|
+
const testName = `${convention.testPrefix}${testParsed.name}${convention.testSuffix}${convention.testExtension}`;
|
|
128
|
+
return path.join(root, testParsed.dir, testName);
|
|
129
|
+
}
|
|
130
|
+
case 'test-project': {
|
|
131
|
+
// Separate test project: src/MyApp/User.cs -> tests/MyApp.Tests/UserTests.cs
|
|
132
|
+
const root = projectRoot || '.';
|
|
133
|
+
const testDir = convention.testDirectory || 'tests';
|
|
134
|
+
let relativePath;
|
|
135
|
+
try {
|
|
136
|
+
relativePath = path.relative(root, dir);
|
|
137
|
+
}
|
|
138
|
+
catch {
|
|
139
|
+
relativePath = dir;
|
|
140
|
+
}
|
|
141
|
+
const cleanPath = relativePath.replace(/^src[\/\\]?/, '');
|
|
142
|
+
const testName = `${convention.testPrefix}${baseName}${convention.testSuffix}${convention.testExtension}`;
|
|
143
|
+
return path.join(root, testDir, cleanPath, testName);
|
|
144
|
+
}
|
|
145
|
+
case 'inline': {
|
|
146
|
+
// Rust: tests go inside the source file itself
|
|
147
|
+
return sourceFile;
|
|
148
|
+
}
|
|
149
|
+
default:
|
|
150
|
+
return path.join(dir, `${baseName}.test${parsed.ext}`);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Get the test file convention for a language
|
|
155
|
+
*/
|
|
156
|
+
export function getTestFileConvention(language) {
|
|
157
|
+
return TEST_FILE_CONVENTIONS[language];
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=test-file-resolver.js.map
|