@@ -412,24 +412,33 @@ export let basicServiceBinding = {
412
412
assert . strictEqual ( await env . self . oneArg ( 3 ) , 36 ) ;
413
413
assert . strictEqual ( await env . self . oneArgOmitCtx ( 3 ) , 37 ) ;
414
414
assert . strictEqual ( await env . self . oneArgOmitEnvCtx ( 3 ) , 6 ) ;
415
- assert . rejects ( ( ) => env . self . twoArgs ( 123 , 2 ) ,
415
+ await assert . rejects ( ( ) => env . self . twoArgs ( 123 , 2 ) , {
416
+ name : "TypeError" ,
417
+ message :
416
418
"Cannot call handler function \"twoArgs\" over RPC because it has the wrong " +
417
419
"number of arguments. A simple function handler can only be called over RPC if it has " +
418
420
"exactly the arguments (arg, env, ctx), where only the first argument comes from the " +
419
421
"client. To support multi-argument RPC functions, use class-based syntax (extending " +
420
- "WorkerEntrypoint) instead." ) ;
421
- assert . rejects ( ( ) => env . self . noArgs ( ) ,
422
+ "WorkerEntrypoint) instead."
423
+ } ) ;
424
+ await assert . rejects ( ( ) => env . self . noArgs ( ) , {
425
+ name : "TypeError" ,
426
+ message :
422
427
"Attempted to call RPC function \"noArgs\" with the wrong number of arguments. " +
423
428
"When calling a top-level handler function that is not declared as part of a class, you " +
424
429
"must always send exactly one argument. In order to support variable numbers of " +
425
430
"arguments, the server must use class-based syntax (extending WorkerEntrypoint) " +
426
- "instead." ) ;
427
- assert . rejects ( ( ) => env . self . oneArg ( 1 , 2 ) ,
431
+ "instead."
432
+ } ) ;
433
+ await assert . rejects ( ( ) => env . self . oneArg ( 1 , 2 ) , {
434
+ name : "TypeError" ,
435
+ message :
428
436
"Attempted to call RPC function \"oneArg\" with the wrong number of arguments. " +
429
437
"When calling a top-level handler function that is not declared as part of a class, you " +
430
438
"must always send exactly one argument. In order to support variable numbers of " +
431
439
"arguments, the server must use class-based syntax (extending WorkerEntrypoint) " +
432
- "instead." ) ;
440
+ "instead."
441
+ } ) ;
433
442
434
443
// If we restore multi-arg support, remove the `rejects` checks above and un-comment these:
435
444
// assert.strictEqual(await env.self.noArgs(), 13);
0 commit comments