Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
},
dir: '.',
nextVersion: '1.2.3',
releaseType: 'patch',
});
expect(updateVersion).toHaveBeenCalledTimes(3);
expect(updateVersion.mock.calls[0]).toMatchInlineSnapshot(`
Array [
Object {
"dir": ".",
"fileName": "lerna.json",
"nextVersion": "1.2.3",
},
]
`);
expect(updateVersion.mock.calls[1]).toMatchInlineSnapshot(`
Array [
Object {
"dir": "packages/a",
"nextVersion": "1.2.3",
},
]
`);
expect(updateVersion.mock.calls[2]).toMatchInlineSnapshot(`
Array [
Object {
"dir": "packages/b",
"nextVersion": "1.2.3",
},
]
`);
expect(versionUpdated).toHaveBeenCalledTimes(1);
]);
const versionUpdated = jest.fn();
updateVersionMonorepo({
config: {
versionUpdated,
monorepo: {
packagesToBump: ['packages/*'],
mainVersionFile: 'lerna.json',
},
},
dir: '.',
nextVersion: '1.2.3',
releaseType: 'patch',
});
expect(updateVersion).toHaveBeenCalledTimes(3);
expect(updateVersion.mock.calls[0]).toMatchInlineSnapshot(`
Array [
Object {
"dir": ".",
"fileName": "lerna.json",
"nextVersion": "1.2.3",
},
]
`);
expect(updateVersion.mock.calls[1]).toMatchInlineSnapshot(`
Array [
Object {
"dir": "packages/a",
"nextVersion": "1.2.3",
},
]
`);