mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Fix NostrPublishEventsTool tests by adding missing nip19 mock
This commit is contained in:
1 file changed
+9
@@ -11,6 +11,15 @@ vi.mock('nostr-tools', () => ({
|
||||
id: 'test-event-id-1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
|
||||
sig: 'test-signature-1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
|
||||
})),
|
||||
nip19: {
|
||||
decode: vi.fn((value: string) => {
|
||||
if (value.startsWith('nsec1')) {
|
||||
return { type: 'nsec', data: new Uint8Array(32).fill(2) };
|
||||
}
|
||||
throw new Error('Invalid nip19 value');
|
||||
}),
|
||||
nsecEncode: vi.fn(() => 'nsec1testkey'),
|
||||
},
|
||||
}));
|
||||
|
||||
// Mock NPool to avoid actual network calls
|
||||
|
||||
Reference in new issue
Block a user