Skip to content
Snippets Groups Projects
Select Git revision
  • e4b70cd932c2b0cdfeabe3a5824c2bd13acfa736
  • main default protected
  • release-0.15
  • automated-updates-main
  • release-0.13
  • automated-updates-release-0.13
  • release-0.14
  • release-0.10
  • release-0.11
  • release-0.12
  • fix-versions-action
  • versions-fix
  • release-0.9
  • release-0.8
  • release-0.7
  • release-0.6
  • release-0.5
  • release-0.4
  • release-0.3
  • release-0.1
  • release-0.2
  • v0.15.0
  • v0.14.0
  • v0.13.0
  • v0.12.0
  • v0.11.0
  • v0.10.0
  • v0.9.0
  • v0.8.0
  • v0.7.0
  • v0.6.0
  • v0.5.0
  • v0.4.0
  • v0.3.0
  • v0.2.0
  • v0.1.0
36 results

migration-guide.md

Blame
  • util.spec.ts 7.41 KiB
    import { Readable } from 'stream';
    import { streamToString } from '../../../util/streams';
    import {
      getBranchNameWithoutRefsheadsPrefix,
      getGitStatusContextCombinedName,
      getGitStatusContextFromCombinedName,
      getNewBranchName,
      getProjectAndRepo,
      getRenovatePRFormat,
      getRepoByName,
      getStorageExtraCloneOpts,
      max4000Chars,
    } from './util';
    
    describe('modules/platform/azure/util', () => {
      describe('getNewBranchName', () => {
        it('should add refs/heads', () => {
          const res = getNewBranchName('testBB');
          expect(res).toBe(`refs/heads/testBB`);
        });
    
        it('should be the same', () => {
          const res = getNewBranchName('refs/heads/testBB');
          expect(res).toBe(`refs/heads/testBB`);
        });
      });
    
      describe('getGitStatusContextCombinedName', () => {
        it('should return undefined if null context passed', () => {
          const contextName = getGitStatusContextCombinedName(null);
          expect(contextName).toBeUndefined();
        });
    
        it('should combine valid genre and name with slash', () => {
          const contextName = getGitStatusContextCombinedName({
            genre: 'my-genre',
            name: 'status-name',
          });
          expect(contextName).toMatch('my-genre/status-name');
        });
    
        it('should combine valid empty genre and name without a slash', () => {
          const contextName = getGitStatusContextCombinedName({
            genre: undefined,
            name: 'status-name',
          });
          expect(contextName).toMatch('status-name');
        });
      });
    
      describe('getGitStatusContextFromCombinedName', () => {
        it('should return undefined if null context passed', () => {
          const context = getGitStatusContextFromCombinedName(null);
          expect(context).toBeUndefined();
        });
    
        it('should parse valid genre and name with slash', () => {
          const context = getGitStatusContextFromCombinedName(
            'my-genre/status-name'
          );
          expect(context).toEqual({
            genre: 'my-genre',
            name: 'status-name',
          });
        });
    
        it('should parse valid genre and name with multiple slashes', () => {
          const context = getGitStatusContextFromCombinedName(
            'my-genre/sub-genre/status-name'
          );