1
1
import { generatePrivateKey } from "viem/accounts" ;
2
2
import { describe , expect , test } from "vitest" ;
3
- import type { Message } from "../src/lib/types" ;
4
3
import { createUser , XMTP , xmtpClient } from "../src/lib/xmtp" ;
5
4
6
5
describe ( "Client Private Key Configuration Tests" , ( ) => {
@@ -30,7 +29,7 @@ describe("Client Private Key Configuration Tests", () => {
30
29
} , 15000 ) ; // Added 15 second timeout
31
30
32
31
test ( "Creates a key with a agent name" , async ( ) => {
33
- const agentName = "bob1 " ;
32
+ const agentName = "bob3 " ;
34
33
const xmtp = await xmtpClient ( {
35
34
name : agentName ,
36
35
} ) ;
@@ -53,46 +52,4 @@ describe("Client Private Key Configuration Tests", () => {
53
52
expect ( ( error as Error ) . message ) . toContain ( "invalid private key" ) ;
54
53
}
55
54
} , 15000 ) ; // Added 15 second timeout
56
-
57
- test ( "Creates a key with a agent name" , async ( ) => {
58
- const agentName = "bob1" ;
59
- const xmtp = await xmtpClient ( {
60
- name : agentName ,
61
- onMessage : async ( message : Message ) => {
62
- await new Promise ( ( resolve ) => setTimeout ( resolve , 1000 ) ) ;
63
- console . log (
64
- "message received" ,
65
- message . content . text ,
66
- "from" ,
67
- message . sender . address ,
68
- ) ;
69
- } ,
70
- } ) ;
71
- const xmtp2 = await xmtpClient ( {
72
- name : "alice1" ,
73
- onMessage : async ( message : Message ) => {
74
- await new Promise ( ( resolve ) => setTimeout ( resolve , 1000 ) ) ;
75
- console . log (
76
- "message received" ,
77
- message . content . text ,
78
- "from" ,
79
- message . sender . address ,
80
- ) ;
81
- } ,
82
- } ) ;
83
-
84
- const message1 = await xmtp . send ( {
85
- message : "Hello, Alice!" ,
86
- receivers : [ xmtp2 . inboxId || "" ] ,
87
- metadata : { } ,
88
- } ) ;
89
- const message2 = await xmtp2 . send ( {
90
- message : "Hello, Bob!" ,
91
- receivers : [ xmtp . inboxId || "" ] ,
92
- metadata : { } ,
93
- } ) ;
94
-
95
- expect ( message1 ) . toBeDefined ( ) ;
96
- expect ( message2 ) . toBeDefined ( ) ;
97
- } , 15000 ) ;
98
55
} ) ;
0 commit comments