@@ -88,3 +88,49 @@ test('parametric case insensitive with capital letter', t => {
88
88
89
89
findMyWay . lookup ( { method : 'GET' , url : '/Foo/bAR' , headers : { } } , null )
90
90
} )
91
+
92
+ test ( 'case insensitive with capital letter in static path with param' , t => {
93
+ t . plan ( 1 )
94
+
95
+ const findMyWay = FindMyWay ( {
96
+ caseSensitive : false ,
97
+ defaultRoute : ( req , res ) => {
98
+ t . fail ( 'Should not be defaultRoute' )
99
+ }
100
+ } )
101
+
102
+ findMyWay . on ( 'GET' , '/Foo/bar/:param' , ( req , res , params ) => {
103
+ console . log ( 'baz' )
104
+ t . equal ( params . param , 'baz' )
105
+ } )
106
+
107
+ findMyWay . lookup ( { method : 'GET' , url : '/Foo/bar/baz' , headers : { } } , null )
108
+ } )
109
+
110
+ test ( 'case insensitive with multiple paths containing capital letter in static path with param' , t => {
111
+ /*
112
+ * This is a reproduction of the issue documented at
113
+ * https://github.com/delvedor/find-my-way/issues/96.
114
+ */
115
+ t . plan ( 2 )
116
+
117
+ const findMyWay = FindMyWay ( {
118
+ caseSensitive : false ,
119
+ defaultRoute : ( req , res ) => {
120
+ t . fail ( 'Should not be defaultRoute' )
121
+ }
122
+ } )
123
+
124
+ findMyWay . on ( 'GET' , '/Foo/bar/:param' , ( req , res , params ) => {
125
+ console . log ( 'baz' )
126
+ t . equal ( params . param , 'baz' )
127
+ } )
128
+
129
+ findMyWay . on ( 'GET' , '/Foo/baz/:param' , ( req , res , params ) => {
130
+ console . log ( 'bar' )
131
+ t . equal ( params . param , 'bar' )
132
+ } )
133
+
134
+ findMyWay . lookup ( { method : 'GET' , url : '/Foo/bar/baz' , headers : { } } , null )
135
+ findMyWay . lookup ( { method : 'GET' , url : '/Foo/baz/bar' , headers : { } } , null )
136
+ } )
0 commit comments