File tree Expand file tree Collapse file tree 1 file changed +30
-1
lines changed
Expand file tree Collapse file tree 1 file changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,8 @@ const assert = require('assert');
99const {
1010 assertIsObject,
1111 assertWithinRange,
12- sessionName
12+ sessionName,
13+ assertIsArray
1314} = require ( 'internal/http2/util' ) ;
1415
1516// Code coverage for sessionName utility function
@@ -49,3 +50,31 @@ assert.throws(
4950 } ) ;
5051
5152assertIsObject ( { } , 'test' ) ;
53+
54+ assert . throws (
55+ ( ) => assertIsArray ( 'foo' , 'test' ) , {
56+ code : 'ERR_INVALID_ARG_TYPE' ,
57+ name : 'TypeError' ,
58+ message : 'The "test" argument must be an instance of Array. Received type ' +
59+ "string ('foo')"
60+ }
61+ ) ;
62+
63+ assert . throws (
64+ ( ) => assertIsArray ( { } , 'test' ) , {
65+ code : 'ERR_INVALID_ARG_TYPE' ,
66+ name : 'TypeError' ,
67+ message : 'The "test" argument must be an instance of Array. Received an instance of Object'
68+ }
69+ ) ;
70+
71+ assert . throws (
72+ ( ) => assertIsArray ( 1 , 'test' ) , {
73+ code : 'ERR_INVALID_ARG_TYPE' ,
74+ name : 'TypeError' ,
75+ message : 'The "test" argument must be an instance of Array. Received type ' +
76+ 'number (1)'
77+ }
78+ ) ;
79+
80+ assertIsArray ( [ ] , 'test' ) ;
You can’t perform that action at this time.
0 commit comments