Registry /
testing / repository-provider-test-support
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
generateBranchName
✓ import { generateBranchName } from 'repository-provider-test-support';
✗ const { generateBranchName } = require('repository-provider-test-support');
This package ships with TypeScript types and targets modern Node.js environments. While CommonJS `require()` might work in some transpiled or older setups, ESM `import` is the idiomatic and recommended way to consume this library, especially given its `node: >=24.11.1` engine requirement.
Repository
✓ import type { Repository } from 'repository-provider-test-support';
✗ import { Repository } from 'repository-provider-test-support';
When using TypeScript, `Repository` is typically imported as a type for declaration purposes. It represents the interface expected by functions like `generateBranchName`.
* as TestSupport
✓ import * as TestSupport from 'repository-provider-test-support';
✗ const TestSupport = require('repository-provider-test-support');
This pattern imports all named exports into a single namespace object, useful for accessing multiple utilities without individual named imports. Ensure your build system supports this for ESM.
Demonstrates how to import and use the `generateBranchName` function to create unique branch names within a test environment, by supplying a mock `Repository` object.
import { generateBranchName } from 'repository-provider-test-support';
// Define a minimal mock Repository interface matching the expected API
interface MockRepository {
listBranches(): Promise<{ name: string }[]>;
}
async function demonstrateBranchNameGeneration() {
// Create a mock repository instance for testing
const mockRepo: MockRepository = {
listBranches: async () => [
{ name: 'main' },
{ name: 'feature/alpha' },
{ name: 'feature/beta' },
{ name: 'hotfix/1.0.1' },
{ name: 'bugfix/1' },
{ name: 'bugfix/2' }
],
};
// Generate a new branch name for a general feature pattern
const newFeatureBranch = await generateBranchName(mockRepo, 'feature/*');
console.log(`Generated feature branch: ${newFeatureBranch}`);
// Expected output if feature/alpha, feature/beta exist: 'feature/1' or 'feature/gamma' depending on internal logic.
// Based on README: 'feature/*' implies 'feature/1', 'feature/2', etc.
// Generate a new branch name for a bugfix, iterating on existing ones
const nextBugfixBranch = await generateBranchName(mockRepo, 'bugfix/*');
console.log(`Generated next bugfix branch: ${nextBugfixBranch}`);
// Expected output: 'bugfix/3'
// Generate a branch name for a specific release iteration
const releaseCandidateBranch = await generateBranchName(mockRepo, 'release/v1.1.*');
console.log(`Generated release candidate branch: ${releaseCandidateBranch}`);
// Expected output: 'release/v1.1.1' if 'release/v1.1.0' doesn't exist
}
demonstrateBranchNameGeneration().catch(console.error);
Errors
Common errors & fixes
TypeError: (0 , repository_provider_test_support__WEBPACK_IMPORTED_MODULE_0__.generateBranchName) is not a function
This error typically indicates an incorrect import statement when using ESM, or attempting to use CommonJS `require()` in an ESM-only context.
fixEnsure you are using `import { generateBranchName } from 'repository-provider-test-support';` and that your project's `package.json` specifies `"type": "module"` or your build configuration is set up for ESM. Error: This package requires Node.js version >=24.11.1. You are running vX.Y.Z.
The installed Node.js version does not meet the minimum requirement specified by the package.
fixUpdate your Node.js environment to version 24.11.1 or newer. Use `nvm install 24` and `nvm use 24` (or similar for other Node.js version managers).
Audit
Dependencies
No dependency data recorded yet.