{"library":"repository-provider-test-support","title":"Repository Provider Test Support","description":"repository-provider-test-support is a utility package designed to provide test support functionalities for libraries that implement the repository-provider interface. It offers helper functions, such as `generateBranchName`, which assists in creating unique branch names within a test environment, often by incorporating a numeric suffix based on a pattern. The package is currently at version 5.0.15 and appears to have a regular release cadence focused on dependency updates and minor bug fixes, indicating active maintenance. It is specifically tailored for testing purposes, making it distinct from general-purpose utility libraries by focusing on the specific needs of repository-provider implementations, such as mock data generation or environment setup for isolated testing. It requires Node.js version 24.11.1 or higher.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install repository-provider-test-support"],"cli":null},"imports":["import { generateBranchName } from 'repository-provider-test-support';","import type { Repository } from 'repository-provider-test-support';","import * as TestSupport from 'repository-provider-test-support';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { generateBranchName } from 'repository-provider-test-support';\n\n// Define a minimal mock Repository interface matching the expected API\ninterface MockRepository {\n  listBranches(): Promise<{ name: string }[]>;\n}\n\nasync function demonstrateBranchNameGeneration() {\n  // Create a mock repository instance for testing\n  const mockRepo: MockRepository = {\n    listBranches: async () => [\n      { name: 'main' },\n      { name: 'feature/alpha' },\n      { name: 'feature/beta' },\n      { name: 'hotfix/1.0.1' },\n      { name: 'bugfix/1' },\n      { name: 'bugfix/2' }\n    ],\n  };\n\n  // Generate a new branch name for a general feature pattern\n  const newFeatureBranch = await generateBranchName(mockRepo, 'feature/*');\n  console.log(`Generated feature branch: ${newFeatureBranch}`);\n  // Expected output if feature/alpha, feature/beta exist: 'feature/1' or 'feature/gamma' depending on internal logic.\n  // Based on README: 'feature/*' implies 'feature/1', 'feature/2', etc.\n\n  // Generate a new branch name for a bugfix, iterating on existing ones\n  const nextBugfixBranch = await generateBranchName(mockRepo, 'bugfix/*');\n  console.log(`Generated next bugfix branch: ${nextBugfixBranch}`);\n  // Expected output: 'bugfix/3'\n\n  // Generate a branch name for a specific release iteration\n  const releaseCandidateBranch = await generateBranchName(mockRepo, 'release/v1.1.*');\n  console.log(`Generated release candidate branch: ${releaseCandidateBranch}`);\n  // Expected output: 'release/v1.1.1' if 'release/v1.1.0' doesn't exist\n}\n\ndemonstrateBranchNameGeneration().catch(console.error);\n","lang":"typescript","description":"Demonstrates how to import and use the `generateBranchName` function to create unique branch names within a test environment, by supplying a mock `Repository` object.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}