fix: make cashu tests faster by giving invalid URL

This commit is contained in:
P. Reis 2025-02-14 11:28:10 -03:00
parent ad967bbb5d
commit 461feff952

View file

@ -45,9 +45,9 @@ Deno.test('PUT /wallet must be successful', {
headers: [['content-type', 'application/json']], headers: [['content-type', 'application/json']],
body: JSON.stringify({ body: JSON.stringify({
mints: [ mints: [
'https://houston.mint.com', 'ditto://houston.mint.com',
'https://houston.mint.com', // duplicate on purpose 'ditto://houston.mint.com', // duplicate on purpose
'https://cuiaba.mint.com', 'ditto://cuiaba.mint.com',
], ],
}), }),
}); });
@ -75,8 +75,8 @@ Deno.test('PUT /wallet must be successful', {
assertEquals(data.pubkey_p2pk, p2pk); assertEquals(data.pubkey_p2pk, p2pk);
assertEquals(data.mints, [ assertEquals(data.mints, [
'https://houston.mint.com', 'ditto://houston.mint.com',
'https://cuiaba.mint.com', 'ditto://cuiaba.mint.com',
]); ]);
assertEquals(data.relays, [ assertEquals(data.relays, [
'ws://localhost:4036/relay', 'ws://localhost:4036/relay',
@ -153,7 +153,7 @@ Deno.test('PUT /wallet must NOT be successful: wallet already exists', async ()
method: 'PUT', method: 'PUT',
headers: [['content-type', 'application/json']], headers: [['content-type', 'application/json']],
body: JSON.stringify({ body: JSON.stringify({
mints: ['https://mint.heart.com'], mints: ['ditto://mint.heart.com'],
}), }),
}); });
@ -191,7 +191,7 @@ Deno.test('GET /wallet must be successful', async () => {
pubkey, pubkey,
JSON.stringify([ JSON.stringify([
['privkey', privkey], ['privkey', privkey],
['mint', 'https://mint.soul.com'], ['mint', 'ditto://mint.soul.com'],
]), ]),
), ),
}, sk)); }, sk));
@ -201,7 +201,7 @@ Deno.test('GET /wallet must be successful', async () => {
kind: 10019, kind: 10019,
tags: [ tags: [
['pubkey', p2pk], ['pubkey', p2pk],
['mint', 'https://mint.soul.com'], ['mint', 'ditto://mint.soul.com'],
], ],
}, sk)); }, sk));
@ -211,7 +211,7 @@ Deno.test('GET /wallet must be successful', async () => {
content: await signer.nip44.encrypt( content: await signer.nip44.encrypt(
pubkey, pubkey,
JSON.stringify({ JSON.stringify({
mint: 'https://mint.soul.com', mint: 'ditto://mint.soul.com',
proofs: [ proofs: [
{ {
id: '005c2502034d4f12', id: '005c2502034d4f12',
@ -252,7 +252,7 @@ Deno.test('GET /wallet must be successful', async () => {
content: 'Nice post!', content: 'Nice post!',
tags: [ tags: [
['p', pubkey], ['p', pubkey],
['u', 'https://mint.soul.com'], ['u', 'ditto://mint.soul.com'],
[ [
'proof', 'proof',
'{"amount":1,"C":"02277c66191736eb72fce9d975d08e3191f8f96afb73ab1eec37e4465683066d3f","id":"000a93d6f8a1d2c4","secret":"[\\"P2PK\\",{\\"nonce\\":\\"b00bdd0467b0090a25bdf2d2f0d45ac4e355c482c1418350f273a04fedaaee83\\",\\"data\\":\\"02eaee8939e3565e48cc62967e2fde9d8e2a4b3ec0081f29eceff5c64ef10ac1ed\\"}]"}', '{"amount":1,"C":"02277c66191736eb72fce9d975d08e3191f8f96afb73ab1eec37e4465683066d3f","id":"000a93d6f8a1d2c4","secret":"[\\"P2PK\\",{\\"nonce\\":\\"b00bdd0467b0090a25bdf2d2f0d45ac4e355c482c1418350f273a04fedaaee83\\",\\"data\\":\\"02eaee8939e3565e48cc62967e2fde9d8e2a4b3ec0081f29eceff5c64ef10ac1ed\\"}]"}',
@ -269,7 +269,7 @@ Deno.test('GET /wallet must be successful', async () => {
assertEquals(response.status, 200); assertEquals(response.status, 200);
assertEquals(body, { assertEquals(body, {
pubkey_p2pk: p2pk, pubkey_p2pk: p2pk,
mints: ['https://mint.soul.com'], mints: ['ditto://mint.soul.com'],
relays: ['ws://localhost:4036/relay'], relays: ['ws://localhost:4036/relay'],
balance: 100, balance: 100,
}); });