11const assert = require ( 'assert' )
2+ const { describe, it } = require ( 'node:test' ) ;
23
34const address = require ( '../index' )
45
56describe ( 'isAllLower' , function ( ) {
6- it ( 'lower latin string' , function ( done ) {
7+ it ( 'lower latin string' , function ( ) {
78 assert . equal ( true , address . isAllLower ( 'abcdefg' ) )
8- done ( )
99 } )
1010} )
1111
1212describe ( 'isAllUpper' , function ( ) {
13- it ( 'upper latin string' , function ( done ) {
13+ it ( 'upper latin string' , function ( ) {
1414 assert . equal ( true , address . isAllUpper ( 'ABCDEFG' ) )
15- done ( )
1615 } )
1716} )
1817
1918describe ( 'nameCase' , function ( ) {
20- it ( 'john doe -> John Doe' , function ( done ) {
19+ it ( 'john doe -> John Doe' , function ( ) {
2120 assert . equal ( 'John Doe' , address . nameCase ( 'john doe' ) )
22- done ( )
2321 } )
24- it ( 'JANE SMITH -> Jane Smith' , function ( done ) {
22+ it ( 'JANE SMITH -> Jane Smith' , function ( ) {
2523 assert . equal ( 'Jane Smith' , address . nameCase ( 'JANE SMITH' ) )
26- done ( )
2724 } )
28- it ( 'marty mcleod -> Marty McLeod' , function ( done ) {
25+ it ( 'marty mcleod -> Marty McLeod' , function ( ) {
2926 assert . equal ( 'Marty McLeod' , address . nameCase ( 'marty mcleod' ) )
30- done ( )
3127 } )
32- it ( "martin o'mally -> Martin O'Malley" , function ( done ) {
28+ it ( "martin o'mally -> Martin O'Malley" , function ( ) {
3329 assert . equal ( "Martin O'Malley" , address . nameCase ( "martin o'malley" ) )
34- done ( )
3530 } )
36- it ( 'level iii support -> Level III Support' , function ( done ) {
31+ it ( 'level iii support -> Level III Support' , function ( ) {
3732 assert . equal ( 'Level III Support' , address . nameCase ( 'level iii support' ) )
38- done ( )
3933 } )
4034} )
4135
@@ -82,7 +76,7 @@ describe('parseSender', function () {
8276} )
8377
8478describe ( 'parseReplyTo' , function ( ) {
85- it ( '=?utf-8?Q?Anne=20Standley=2C=20Protect=20My=20Public=20Media?= <[email protected] >' , function ( done ) { 79+ it ( '=?utf-8?Q?Anne=20Standley=2C=20Protect=20My=20Public=20Media?= <[email protected] >' , function ( ) { 8680 try {
8781 const r = address . parseReplyTo (
8882 '=?utf-8?Q?Anne=20Standley=2C=20Protect=20My=20Public=20Media?= <[email protected] >' , @@ -97,21 +91,19 @@ describe('parseReplyTo', function () {
9791 } catch ( e ) {
9892 console . error ( e )
9993 }
100- done ( )
10194 } )
10295} )
10396
10497describe ( 'parse with options' , function ( ) {
105- it ( 'should not allow parsing display name with comma by default' , function ( done ) {
98+ it ( 'should not allow parsing display name with comma by default' , function ( ) {
10699 try {
107100 address . parse ( 'Foo, Bar <[email protected] >' ) 108101 } catch ( e ) {
109102 assert . equal ( e . message , 'No results' )
110103 }
111- done ( )
112104 } )
113105
114- it ( 'should allow parsing display name with comma' , function ( done ) {
106+ it ( 'should allow parsing display name with comma' , function ( ) {
115107 try {
116108 const [ r ] = address . parse ( 'Foo, Bar <[email protected] >' , { 117109 allowCommaInDisplayName : true ,
@@ -121,6 +113,5 @@ describe('parse with options', function () {
121113 } catch ( e ) {
122114 console . error ( e )
123115 }
124- done ( )
125116 } )
126117} )
0 commit comments