You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

24 lines
636 B

import { describe, expect, it } from 'vitest'
import { parseNostrSpecAffectedKinds } from './nostr-spec-affected-kinds'
describe('parseNostrSpecAffectedKinds', () => {
it('parses one kind per row and dedupes', () => {
expect(
parseNostrSpecAffectedKinds([
{ id: '1', value: '1' },
{ id: '2', value: ' 42 ' },
{ id: '3', value: '1' }
])
).toEqual([1, 42])
})
it('skips empty and invalid rows', () => {
expect(
parseNostrSpecAffectedKinds([
{ id: '1', value: '' },
{ id: '2', value: 'abc' },
{ id: '3', value: '-1' }
])
).toEqual([])
})
})