Skip to content

Commit

Permalink
[wip] frozen-lockfile test if catalogs config is modified
Browse files Browse the repository at this point in the history
  • Loading branch information
gluxon committed Apr 22, 2024
1 parent a01a9be commit 5938bb7
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions pkg-manager/plugin-commands-installation/test/catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,3 +322,40 @@ test('lockfile catalog snapshots should keep unused entries', async () => {
})
}
})

test.skip('throws frozen-lockfile error if catalog is modified', async () => {
await using ctrl = new CatalogTestsController([
{
location: 'packages/project1',
package: {
dependencies: {
'is-positive': 'catalog:',
},
},
},
])

await ctrl.writeWorkspaceYml({
packages: ['packages/*'],
catalog: { 'is-positive': '=1.0.0' },
})
await ctrl.install()

expect((await ctrl.lockfile()).importers['packages/project1']).toEqual({
dependencies: {
'is-positive': {
specifier: 'catalog:',
version: '1.0.0',
},
},
})

await ctrl.writeWorkspaceYml({
packages: ['packages/*'],
catalog: {
'is-positive': '=3.1.0',
},
})

await expect(() => ctrl.install({ frozenLockfile: true })).rejects.toThrow()
})

0 comments on commit 5938bb7

Please sign in to comment.