mirror of
https://github.com/pnpm/pnpm.git
synced 2026-04-04 23:34:58 -04:00
* 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
27 lines
563 B
TypeScript
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>)
|
|
})
|