mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 00:56:44 +01:00
assert.throws
This commit is contained in:
parent
94b7902390
commit
e0762fd1ba
@ -25,6 +25,18 @@ assert.soon = function( f ) {
|
||||
}
|
||||
}
|
||||
|
||||
assert.throws = function( func , params , msg ){
|
||||
|
||||
try {
|
||||
func.apply( null , params );
|
||||
}
|
||||
catch ( e ){
|
||||
return e;
|
||||
}
|
||||
|
||||
throw "did not throw exception: " + msg ;
|
||||
}
|
||||
|
||||
Object.extend = function( dst , src ){
|
||||
for ( var k in src ){
|
||||
dst[k] = src[k];
|
||||
|
Loading…
Reference in New Issue
Block a user