0
0
mirror of https://github.com/renovatebot/renovate.git synced 2024-12-22 21:48:32 +00:00
renovatebot_renovate/lib/modules/manager/pip-compile/utils.spec.ts
Norbert Szulc 8f02c53039
feat(manager/pip-compile): Allow paths relative to repository root (#27272)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2024-02-20 17:45:15 +00:00

30 lines
776 B
TypeScript

import { inferCommandExecDir } from './utils';
describe('modules/manager/pip-compile/utils', () => {
describe('inferCommandExecDir()', () => {
it.each([
{
fileName: 'subdir/reqs.txt',
outputFile: 'subdir/reqs.txt',
result: '.',
},
{
fileName: 'subdir/reqs.txt',
outputFile: 'reqs.txt',
result: 'subdir',
},
])(
'returns object on correct options',
({ fileName, outputFile, result }) => {
expect(inferCommandExecDir(fileName, outputFile)).toEqual(result);
},
);
it('throw if --output-file basename differs from path', () => {
expect(() =>
inferCommandExecDir('subdir/requirements.txt', 'hey.txt'),
).toThrow(/mismatch/);
});
});
});