mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-13 07:26:26 +00:00
33 lines
842 B
JavaScript
33 lines
842 B
JavaScript
|
const {
|
||
|
flattenUpdates,
|
||
|
} = require('../../../../lib/workers/repository/updates/flatten');
|
||
|
|
||
|
let config;
|
||
|
beforeEach(() => {
|
||
|
jest.resetAllMocks();
|
||
|
config = { ...require('../../../_fixtures/config') };
|
||
|
config.errors = [];
|
||
|
config.warnings = [];
|
||
|
});
|
||
|
|
||
|
describe('workers/repository/updates/flatten', () => {
|
||
|
describe('flattenUpdates()', () => {
|
||
|
it('flattens', async () => {
|
||
|
config.lockFileMaintenance.enabled = true;
|
||
|
const packageFiles = {
|
||
|
npm: [
|
||
|
{
|
||
|
packageFile: 'package.json ',
|
||
|
deps: [
|
||
|
{ depName: '@org/a', updates: [{ newVersion: '1.0.0' }] },
|
||
|
{ updates: [{ newVersion: '2.0.0' }] },
|
||
|
],
|
||
|
},
|
||
|
],
|
||
|
};
|
||
|
const res = await flattenUpdates(config, packageFiles);
|
||
|
expect(res).toMatchSnapshot();
|
||
|
});
|
||
|
});
|
||
|
});
|