fix: Maven-based update functions (#5405)

This commit is contained in:
Sergio Zharinov 2020-02-07 20:23:29 +04:00 committed by GitHub
parent 0b61cfc171
commit b6d84a2775
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 4 deletions

View file

@ -18,7 +18,7 @@ describe('manager/deps-edn/update', () => {
newValue: `${dep.currentValue}-9999`,
};
const { currentValue, newValue } = upgrade;
const newFileContent = updateDependency(depsEdn, upgrade);
const newFileContent = updateDependency({ fileContent: depsEdn, upgrade });
const cmpContent = depsEdn.replace(currentValue, newValue);
expect(newFileContent).toEqual(cmpContent);
});

View file

@ -1 +1,9 @@
export { updateAtPosition as updateDependency } from '../maven/update';
import { UpdateDependencyConfig } from '../common';
import { updateAtPosition } from '../maven/update';
export function updateDependency({
fileContent,
upgrade,
}: UpdateDependencyConfig): string | null {
return updateAtPosition(fileContent, upgrade);
}

View file

@ -18,7 +18,10 @@ describe('manager/leiningen/update', () => {
newValue: `${dep.currentValue}-9999`,
};
const { currentValue, newValue } = upgrade;
const newFileContent = updateDependency(leinProjectClj, upgrade);
const newFileContent = updateDependency({
fileContent: leinProjectClj,
upgrade,
});
const cmpContent = leinProjectClj.replace(currentValue, newValue);
expect(newFileContent).toEqual(cmpContent);
});

View file

@ -1 +1,9 @@
export { updateAtPosition as updateDependency } from '../maven/update';
import { UpdateDependencyConfig } from '../common';
import { updateAtPosition } from '../maven/update';
export function updateDependency({
fileContent,
upgrade,
}: UpdateDependencyConfig): string | null {
return updateAtPosition(fileContent, upgrade);
}