Skip to content

Commit 8ca5e6d

Browse files
🔍 test: Fix t.throws calls.
1 parent 807a30f commit 8ca5e6d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/src/chainmap.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ test( "chainmap" , t => {
9090

9191
M = M.parents( ) ;
9292

93-
t.throws( M.get.bind( M , "w" ) , KeyError , "w throws" ) ;
93+
t.throws( M.get.bind( M , "w" ) , { instanceOf: KeyError } , "w throws" ) ;
9494

9595
t.deepEqual( M.len( ) , 3 , "-w DBAC len" ) ;
9696
t.deepEqual( M.get( "x" ) , "B" , "-w BAC depth 1" ) ;
@@ -102,7 +102,7 @@ test( "chainmap" , t => {
102102
t.true( M.has( "z" ) , "has z BAC depth 3" ) ;
103103

104104
t.deepEqual( M.delete( "x" ).len( ) , 3 , "delete" ) ;
105-
t.throws( M.delete.bind( M , "x" ) , KeyError , "delete raises" ) ;
105+
t.throws( M.delete.bind( M , "x" ) , { instanceOf: KeyError } , "delete raises" ) ;
106106
t.deepEqual( M.get( "x" ) , "A" , "-wx AC depth 1" ) ;
107107

108108
t.deepEqual( chainmap( C ).clear( ).len( ) , 0 , "clear" ) ;
@@ -117,8 +117,8 @@ test( "chainmap" , t => {
117117

118118
M = chainmap.fromkeys( "x" ).new_child( ) ;
119119

120-
t.throws( M.popitem.bind( M ) , KeyError , "popitem empty map[0]" ) ;
121-
t.throws( M.pop.bind( M , "x" ) , KeyError , "pop empty map[0]" ) ;
120+
t.throws( M.popitem.bind( M ) , { instanceOf: KeyError } , "popitem empty map[0]" ) ;
121+
t.throws( M.pop.bind( M , "x" ) , { instanceOf: KeyError } , "pop empty map[0]" ) ;
122122

123123
t.deepEqual( chainmap( ).getdefault( "y" ) , null , "getdefault null" ) ;
124124
t.deepEqual( chainmap( ).getdefault( "y" , "A" ) , "A" , "getdefault A" ) ;

0 commit comments

Comments
 (0)