@@ -131,6 +131,16 @@ describe('GetFilenameFromUrl', () => {
131
131
publicPath : '/' ,
132
132
expected : '/foo/sample.js'
133
133
} ,
134
+ {
135
+ url : '/js/sample.js' ,
136
+ compilers : [
137
+ { outputPath : '/foo' , options : { output : { publicPath : 'http://localhost/js/' } } } ,
138
+ { outputPath : '/bar' , options : { output : { publicPath : 'http://localhost/css/' } } }
139
+ ] ,
140
+ outputPath : '/root' ,
141
+ publicPath : '/' ,
142
+ expected : '/foo/sample.js'
143
+ } ,
134
144
{
135
145
url : '/css/sample.css' ,
136
146
compilers : [
@@ -141,6 +151,16 @@ describe('GetFilenameFromUrl', () => {
141
151
publicPath : '/' ,
142
152
expected : '/bar/sample.css'
143
153
} ,
154
+ {
155
+ url : '/css/sample.css' ,
156
+ compilers : [
157
+ { outputPath : '/foo' , options : { output : { publicPath : 'http://localhost/js/' } } } ,
158
+ { outputPath : '/bar' , options : { output : { publicPath : 'http://localhost/css/' } } }
159
+ ] ,
160
+ outputPath : '/root' ,
161
+ publicPath : '/' ,
162
+ expected : '/bar/sample.css'
163
+ } ,
144
164
{
145
165
url : '/other/sample.txt' ,
146
166
compilers : [
@@ -151,6 +171,16 @@ describe('GetFilenameFromUrl', () => {
151
171
publicPath : '/' ,
152
172
expected : '/root/other/sample.txt'
153
173
} ,
174
+ {
175
+ url : '/other/sample.txt' ,
176
+ compilers : [
177
+ { outputPath : '/foo' , options : { output : { publicPath : 'http://localhost/js/' } } } ,
178
+ { outputPath : '/bar' , options : { output : { publicPath : 'http://localhost/css/' } } }
179
+ ] ,
180
+ outputPath : '/root' ,
181
+ publicPath : '/' ,
182
+ expected : '/root/other/sample.txt'
183
+ } ,
154
184
{
155
185
url : '/js/sample.js' ,
156
186
compilers : [
@@ -161,6 +191,16 @@ describe('GetFilenameFromUrl', () => {
161
191
publicPath : '/test/' ,
162
192
expected : '/foo/sample.js'
163
193
} ,
194
+ {
195
+ url : '/js/sample.js' ,
196
+ compilers : [
197
+ { outputPath : '/foo' , options : { output : { publicPath : 'http://localhost/js/' } } } ,
198
+ { outputPath : '/bar' , options : { output : { publicPath : 'http://localhost/css/' } } }
199
+ ] ,
200
+ outputPath : '/root' ,
201
+ publicPath : '/test/' ,
202
+ expected : '/foo/sample.js'
203
+ } ,
164
204
{
165
205
url : '/css/sample.css' ,
166
206
compilers : [
@@ -171,6 +211,16 @@ describe('GetFilenameFromUrl', () => {
171
211
publicPath : '/test/' ,
172
212
expected : '/bar/sample.css'
173
213
} ,
214
+ {
215
+ url : '/css/sample.css' ,
216
+ compilers : [
217
+ { outputPath : '/foo' , options : { output : { publicPath : 'http://localhost/js/' } } } ,
218
+ { outputPath : '/bar' , options : { output : { publicPath : 'http://localhost/css/' } } }
219
+ ] ,
220
+ outputPath : '/root' ,
221
+ publicPath : '/test/' ,
222
+ expected : '/bar/sample.css'
223
+ } ,
174
224
{
175
225
url : '/other/sample.txt' ,
176
226
compilers : [
@@ -181,6 +231,16 @@ describe('GetFilenameFromUrl', () => {
181
231
publicPath : '/test/' ,
182
232
expected : false
183
233
} ,
234
+ {
235
+ url : '/other/sample.txt' ,
236
+ compilers : [
237
+ { outputPath : '/foo' , options : { output : { publicPath : 'http://localhost/js/' } } } ,
238
+ { outputPath : '/bar' , options : { output : { publicPath : 'http://localhost/css/' } } }
239
+ ] ,
240
+ outputPath : '/root' ,
241
+ publicPath : '/test/' ,
242
+ expected : false
243
+ } ,
184
244
{
185
245
url : '/test/sample.txt' ,
186
246
compilers : [
@@ -190,6 +250,16 @@ describe('GetFilenameFromUrl', () => {
190
250
outputPath : '/root' ,
191
251
publicPath : '/test/' ,
192
252
expected : '/root/sample.txt'
253
+ } ,
254
+ {
255
+ url : '/test/sample.txt' ,
256
+ compilers : [
257
+ { outputPath : '/foo' , options : { output : { publicPath : 'http://localhost/js/' } } } ,
258
+ { outputPath : '/bar' , options : { output : { publicPath : 'http://localhost/css/' } } }
259
+ ] ,
260
+ outputPath : '/root' ,
261
+ publicPath : '/test/' ,
262
+ expected : '/root/sample.txt'
193
263
}
194
264
] ;
195
265
0 commit comments