Files
renovate/test/other/validate-templatable-fields.spec.ts
Jamie Tanna df7a014c91 refactor: generate the list of templatable fields
As part of follow-up changes, we need a list of fields that could be
used in templates as part of a linting rule.

To avoid the `tools` directory importing from `lib`, we can make sure
that we generate the list of fields.

Co-authored-by: Claude Opus 5 <jamie.tanna+claude-code@mend.io>
2026-08-07 14:28:32 +01:00

22 lines
650 B
TypeScript

import { validMatchFields } from '../../lib/modules/manager/custom/utils.ts';
import {
allowedFields,
exposedConfigOptions,
} from '../../lib/util/template/index.ts';
import { templatableFields } from '../../tools/lint/rules/templatable-fields.generated.ts';
describe('other/validate-templatable-fields', () => {
// if this test fails, run `pnpm generate`
it('generated templatable fields are up to date', () => {
const expected = [
...new Set([
...validMatchFields,
...exposedConfigOptions,
...Object.keys(allowedFields),
]),
].sort();
expect(templatableFields).toEqual(expected);
});
});