Files
pnpm/lockfile/verification/test/diffFlatRecords.test.ts
Khải 86e001604d feat: improve mismatched specifiers error message (#9598)
* feat: improve mismatched specifiers error message

* test: fix

* feat: display as diff

* docs(changeset): change it to minor

* docs(changeset): add tsconfig

* docs(changeset): more details

* feat: make it clear which spec is belongs to which

* docs: update changeset
2025-06-06 09:09:26 +02:00

27 lines
563 B
TypeScript

import { type Diff, diffFlatRecords } from '../src/diffFlatRecords'
test('diffFlatRecords', () => {
const diff = diffFlatRecords<string, string>({
'is-positive': '1.0.0',
'is-negative': '2.0.0',
}, {
'is-negative': '2.1.0',
'is-odd': '1.0.0',
})
expect(diff).toStrictEqual({
added: [{
key: 'is-odd',
value: '1.0.0',
}],
removed: [{
key: 'is-positive',
value: '1.0.0',
}],
modified: [{
key: 'is-negative',
left: '2.0.0',
right: '2.1.0',
}],
} as Diff<string, string>)
})