File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -6,13 +6,18 @@ const options = {
6
6
test : {
7
7
before : async ( ) => {
8
8
let callCount = 0
9
+ let lastCalledUrl = ''
9
10
const providers = new Map ( )
10
11
const peers = new Map ( )
11
12
const ipnsGet = new Map ( )
12
13
const ipnsPut = new Map ( )
13
14
const echo = new EchoServer ( )
14
15
echo . polka . use ( body . raw ( { type : 'application/vnd.ipfs.ipns-record' } ) )
15
16
echo . polka . use ( body . text ( ) )
17
+ echo . polka . use ( ( req , res , next ) => {
18
+ next ( )
19
+ lastCalledUrl = req . url
20
+ } )
16
21
echo . polka . post ( '/add-providers/:cid' , ( req , res ) => {
17
22
callCount ++
18
23
providers . set ( req . params . cid , req . body )
@@ -22,7 +27,6 @@ const options = {
22
27
callCount ++
23
28
const records = providers . get ( req . params . cid ) ?? '[]'
24
29
providers . delete ( req . params . cid )
25
-
26
30
res . end ( records )
27
31
} )
28
32
echo . polka . post ( '/add-peers/:peerId' , ( req , res ) => {
@@ -68,6 +72,9 @@ const options = {
68
72
callCount = 0
69
73
res . end ( )
70
74
} )
75
+ echo . polka . get ( '/last-called-url' , ( req , res ) => {
76
+ res . end ( lastCalledUrl )
77
+ } )
71
78
72
79
await echo . start ( )
73
80
You can’t perform that action at this time.
0 commit comments