diff --git a/lib/config/options/index.spec.ts b/lib/config/options/index.spec.ts index 26bb5938fd0..efc1e65fbdc 100644 --- a/lib/config/options/index.spec.ts +++ b/lib/config/options/index.spec.ts @@ -1,6 +1,7 @@ import { isNullOrUndefined } from '@sindresorhus/is'; import * as manager from '../../modules/manager'; import * as platform from '../../modules/platform'; +import type { RenovateOptions } from '../types'; import { getOptions } from '.'; vi.unmock('../../modules/platform'); @@ -66,4 +67,19 @@ describe('config/options/index', () => { } } }); + + it('are in alphabetical order, based on `name`', () => { + const keys = function (opts: RenovateOptions[]): string[] { + return opts.map((opt) => opt.name); + }; + + const opts = getOptions(); + + const sortedOpts = [...opts].sort((a, b) => a.name.localeCompare(b.name)); + + expect( + keys(opts), + 'Configuration options should be in alphabetical order based on the `name` key', + ).toStrictEqual(keys(sortedOpts)); + }); });