mirror of
https://github.com/renovatebot/renovate.git
synced 2026-10-31 09:41:46 +00:00
930cf6633c
fix: Additional vi.mock path corrections and prettier formatting
46 lines
1.6 KiB
TypeScript
46 lines
1.6 KiB
TypeScript
import { minimatch } from '../../../util/minimatch.ts';
|
|
import { matchRegexOrGlobList } from '../../../util/string-match.ts';
|
|
import { defaultConfig } from './default-config.ts';
|
|
|
|
describe('modules/manager/hermit/default-config', () => {
|
|
describe('excludeCommitPaths', () => {
|
|
function miniMatches(target: string, patterns: string[]): boolean {
|
|
return patterns.some((patt: string) => {
|
|
return minimatch(patt, { dot: true }).match(target);
|
|
});
|
|
}
|
|
|
|
it.each`
|
|
path | expected
|
|
${'bin/hermit'} | ${true}
|
|
${'gradle/bin/hermit'} | ${true}
|
|
${'nested/module/bin/hermit'} | ${true}
|
|
${'nested/testbin/hermit'} | ${false}
|
|
${'other'} | ${false}
|
|
${'nested/other'} | ${false}
|
|
${'nested/module/other'} | ${false}
|
|
`('minimatches("$path") === $expected', ({ path, expected }) => {
|
|
expect(miniMatches(path, defaultConfig.excludeCommitPaths)).toBe(
|
|
expected,
|
|
);
|
|
});
|
|
});
|
|
|
|
describe('managerFilePatterns', () => {
|
|
it.each`
|
|
path | expected
|
|
${'bin/hermit'} | ${true}
|
|
${'gradle/bin/hermit'} | ${true}
|
|
${'nested/module/bin/hermit'} | ${true}
|
|
${'nested/testbin/hermit'} | ${false}
|
|
${'other'} | ${false}
|
|
${'nested/other'} | ${false}
|
|
${'nested/module/other'} | ${false}
|
|
`('matchRegexOrGlobList("$path") === $expected', ({ path, expected }) => {
|
|
expect(
|
|
matchRegexOrGlobList(path, defaultConfig.managerFilePatterns),
|
|
).toBe(expected);
|
|
});
|
|
});
|
|
});
|