@@ -43,9 +43,11 @@ const runTests = (successCase, failCase) => {
43
43
remotable : ( repr , kind ) => `${ kind } ${ repr } - Must be a remotable` ,
44
44
error : ( repr , kind ) => `${ kind } ${ repr } - Must be a error` ,
45
45
promise : ( repr , kind ) => `${ kind } ${ repr } - Must be a promise` ,
46
- undefined : ( repr , kind ) => `${ kind } ${ repr } - Must be a undefined` ,
46
+ // M.undefined() and M.null() match as exact Keys rather than kinds.
47
+ undefined : repr => `${ repr } - Must be: "[undefined]"` ,
47
48
null : repr => `${ repr } - Must be: null` ,
48
49
} ;
50
+ const tagIgnorantMethods = [ 'scalar' , 'key' , 'undefined' , 'null' ] ;
49
51
50
52
{
51
53
const specimen = 3 ;
@@ -525,7 +527,7 @@ const runTests = (successCase, failCase) => {
525
527
continue ;
526
528
}
527
529
// This specimen is not a Key, so testing is less straightforward.
528
- if ( method === 'scalar' || method === 'key' || method === 'null' ) {
530
+ if ( tagIgnorantMethods . includes ( method ) ) {
529
531
successCase ( specimen , M . not ( M [ method ] ( ) ) ) ;
530
532
failCase (
531
533
specimen ,
@@ -567,10 +569,9 @@ const runTests = (successCase, failCase) => {
567
569
continue ;
568
570
}
569
571
// This specimen has an invalid payload for its tag, so testing is less straightforward.
570
- const message =
571
- method === 'scalar' || method === 'key' || method === 'null'
572
- ? makeMessage ( '"[match:any]"' , 'match:any' , 'tagged' )
573
- : 'match:any payload: 88 - Must be undefined' ;
572
+ const message = tagIgnorantMethods . includes ( method )
573
+ ? makeMessage ( '"[match:any]"' , 'match:any' , 'tagged' )
574
+ : 'match:any payload: 88 - Must be undefined' ;
574
575
successCase ( specimen , M . not ( M [ method ] ( ) ) ) ;
575
576
failCase ( specimen , M [ method ] ( ) , message ) ;
576
577
}
@@ -584,7 +585,7 @@ const runTests = (successCase, failCase) => {
584
585
continue ;
585
586
}
586
587
// This specimen is not a Key, so testing is less straightforward.
587
- if ( method === 'scalar' || method === 'key' || method === 'null' ) {
588
+ if ( tagIgnorantMethods . includes ( method ) ) {
588
589
successCase ( specimen , M . not ( M [ method ] ( ) ) ) ;
589
590
failCase (
590
591
specimen ,
0 commit comments