Skip to content

test: cover policy template loading#394

Open
aayushprsingh wants to merge 1 commit into
LF-Decentralized-Trust-labs:mainfrom
aayushprsingh:test/policy-template-loader
Open

test: cover policy template loading#394
aayushprsingh wants to merge 1 commit into
LF-Decentralized-Trust-labs:mainfrom
aayushprsingh:test/policy-template-loader

Conversation

@aayushprsingh

Copy link
Copy Markdown

Summary

  • add coverage for loading shipped policy templates from playbooks/policy-templates
  • assert templates compile without loader errors and default-enabled lookup works case-insensitively

Test plan

  • corepack pnpm vitest run server/src/__tests__/policy-templates-loader.test.ts
  • corepack pnpm check:tokens
  • corepack pnpm --filter @gitmesh/server typecheck (fails on current main because Express Request.actor augmentation file server/src/types/express.d.ts is missing; unrelated to this test-only change)

Signed-off-by: Aayush Pratap Singh <as456pratapayush@gmail.com>
Copilot AI review requested due to automatic review settings May 23, 2026 22:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds Vitest coverage for the policy templates loader to ensure shipped templates load cleanly and key lookup/default-enabled behaviors work.

Changes:

  • Introduces a new test suite validating template loading returns no errors.
  • Adds coverage for case-insensitive template lookup and default-enabled template selection.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


expect(result.loadedFrom).toBeTruthy();
expect(result.errors).toEqual([]);
expect(result.templates.length).toBeGreaterThanOrEqual(5);
Comment on lines +23 to +24
const ciTemplate = findPolicyTemplate("NO-CI-MODIFICATION");
const defaultEnabled = getDefaultEnabledTemplates();

describe("policy templates loader", () => {
it("loads shipped policy templates without compile errors", () => {
clearPolicyTemplateCache();
});

it("finds templates case-insensitively and exposes default-enabled templates", () => {
clearPolicyTemplateCache();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants