File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,11 +54,23 @@ describe('assertString', () => {
5454 assert . throws ( ( ) => { assertString ( [ ] ) ; } , TypeError ) ;
5555 } ) ;
5656
57+ it ( 'Should throw an error if argument provided is an Object pretending to be a \'string\'' , ( ) => {
58+ assert . throws ( ( ) => { assertString ( { constructor : { name : "string" } } ) ; } , TypeError ) ;
59+ } ) ;
60+
61+ it ( 'Should throw an error if argument provided is an Object pretending to be a \'String\'' , ( ) => {
62+ assert . throws ( ( ) => { assertString ( { constructor : { name : "String" } } ) ; } , TypeError ) ;
63+ } ) ;
64+
5765 it ( 'Should not throw an error if the argument is an empty string' , ( ) => {
5866 assert . doesNotThrow ( ( ) => { assertString ( '' ) ; } ) ;
5967 } ) ;
60-
68+
6169 it ( 'Should not throw an error if the argument is a String' , ( ) => {
6270 assert . doesNotThrow ( ( ) => { assertString ( 'antidisestablishmentarianism' ) ; } ) ;
6371 } ) ;
72+
73+ it ( 'Should not throw an error if the argument is a boxed string' , ( ) => {
74+ assert . doesNotThrow ( ( ) => { assertString ( new String ( 'antidisestablishmentarianism' ) ) ; } ) ;
75+ } ) ;
6476} ) ;
You can’t perform that action at this time.
0 commit comments