@@ -3,7 +3,7 @@ import { delay } from "../vendor/https/deno.land/std/async/delay.ts";
33import {
44 assert ,
55 assertEquals ,
6- assertThrowsAsync ,
6+ assertRejects ,
77} from "../vendor/https/deno.land/std/testing/asserts.ts" ;
88import {
99 newClient ,
@@ -42,7 +42,7 @@ suite.test("client caching with opt out", async () => {
4242} ) ;
4343
4444suite . test ( "client caching without opt in or opt out" , async ( ) => {
45- await assertThrowsAsync (
45+ await assertRejects (
4646 ( ) => {
4747 return client . clientCaching ( "YES" ) ;
4848 } ,
@@ -130,7 +130,7 @@ suite.test("client list", async () => {
130130 list = await client . clientList ( { ids : [ id ] } ) ;
131131 assert ( list ! . includes ( `id=${ id } ` ) ) ;
132132
133- await assertThrowsAsync (
133+ await assertRejects (
134134 ( ) => {
135135 return client . clientList ( { type : "MASTER" , ids : [ id ] } ) ;
136136 } ,
@@ -157,7 +157,7 @@ suite.test("client tracking", async () => {
157157 } ) ,
158158 "OK" ,
159159 ) ;
160- await assertThrowsAsync (
160+ await assertRejects (
161161 ( ) => {
162162 return client . clientTracking ( { mode : "ON" , bcast : true , optIn : true } ) ;
163163 } ,
@@ -194,13 +194,14 @@ suite.test("client unblock with error", async () => {
194194 const tempClient = await newClient ( { hostname : "127.0.0.1" , port } ) ;
195195 try {
196196 const id = await tempClient . clientID ( ) ;
197- assertThrowsAsync (
197+ const promise = assertRejects (
198198 ( ) => tempClient . brpop ( 0 , "key1" ) ,
199199 Error ,
200200 "-UNBLOCKED" ,
201201 ) ;
202202 await delay ( 5 ) ; // Give some leeway for brpop to reach redis.
203203 assertEquals ( await client . clientUnblock ( id , "ERROR" ) , 1 ) ;
204+ await promise ;
204205 } finally {
205206 tempClient . close ( ) ;
206207 }
0 commit comments