@@ -30,7 +30,7 @@ using Dash: Resource, ResourcePkg, ResourcesRegistry,
30
30
relative_package_path = " test.js" ,
31
31
async = :lazy
32
32
)
33
-
33
+
34
34
@test test_resource. async == :lazy
35
35
@test isdynamic (test_resource, true )
36
36
@test isdynamic (test_resource, false )
@@ -39,7 +39,7 @@ using Dash: Resource, ResourcePkg, ResourcesRegistry,
39
39
relative_package_path = " test.js" ,
40
40
async = :eager
41
41
)
42
-
42
+
43
43
@test test_resource. async == :eager
44
44
@test ! isdynamic (test_resource, true )
45
45
@test isdynamic (test_resource, false )
77
77
Resource (
78
78
relative_package_path = " dash-renderer/dash_renderer.min.js" ,
79
79
dev_package_path = " dash-renderer/dash_renderer.dev.js" ,
80
- external_url = " https://dash_renderer.min.js"
80
+ external_url = " https://dash_renderer.min.js"
81
81
)
82
82
]
83
- )
83
+ )
84
84
)
85
85
86
86
test_app = dash (include_assets_files = false )
87
87
88
88
app_resources = ApplicationResources (test_app, test_registry)
89
89
@test length (app_resources. css) == 0
90
90
@test length (app_resources. js) == 3
91
- @test app_resources. js[1 ] isa AppRelativeResource
91
+ @test app_resources. js[1 ] isa AppRelativeResource
92
92
@test app_resources. js[1 ]. namespace == " dash_renderer"
93
93
@test app_resources. js[1 ]. relative_path == " path1.prod.js"
94
94
95
- @test app_resources. js[2 ] isa AppRelativeResource
95
+ @test app_resources. js[2 ] isa AppRelativeResource
96
96
@test app_resources. js[2 ]. namespace == " dash_renderer"
97
97
@test app_resources. js[2 ]. relative_path == " path2.prod.js"
98
98
99
- @test app_resources. js[end ] isa AppRelativeResource
99
+ @test app_resources. js[end ] isa AppRelativeResource
100
100
@test app_resources. js[end ]. namespace == " dash_renderer"
101
101
@test app_resources. js[end ]. relative_path == " dash-renderer/dash_renderer.min.js"
102
102
@@ -113,15 +113,15 @@ end
113
113
@test length (app_resources. css) == 0
114
114
@test length (app_resources. js) == 3
115
115
116
- @test app_resources. js[1 ] isa AppRelativeResource
116
+ @test app_resources. js[1 ] isa AppRelativeResource
117
117
@test app_resources. js[1 ]. namespace == " dash_renderer"
118
118
@test app_resources. js[1 ]. relative_path == " path1.prod.js"
119
-
120
- @test app_resources. js[2 ] isa AppRelativeResource
119
+
120
+ @test app_resources. js[2 ] isa AppRelativeResource
121
121
@test app_resources. js[2 ]. namespace == " dash_renderer"
122
122
@test app_resources. js[2 ]. relative_path == " path2.prod.js"
123
-
124
- @test app_resources. js[end ] isa AppRelativeResource
123
+
124
+ @test app_resources. js[end ] isa AppRelativeResource
125
125
@test app_resources. js[end ]. namespace == " dash_renderer"
126
126
@test app_resources. js[end ]. relative_path == " dash-renderer/dash_renderer.dev.js"
127
127
@@ -130,23 +130,23 @@ end
130
130
@test " path1.prod.js" in app_resources. files[" dash_renderer" ]. files
131
131
@test " path2.prod.js" in app_resources. files[" dash_renderer" ]. files
132
132
@test " dash-renderer/dash_renderer.dev.js" in app_resources. files[" dash_renderer" ]. files
133
-
133
+
134
134
test_app = dash (include_assets_files = false )
135
135
enable_dev_tools! (test_app, debug = false , dev_tools_props_check = true , dev_tools_serve_dev_bundles = true )
136
136
137
137
app_resources = ApplicationResources (test_app, test_registry)
138
138
@test length (app_resources. css) == 0
139
139
@test length (app_resources. js) == 3
140
140
141
- @test app_resources. js[1 ] isa AppRelativeResource
141
+ @test app_resources. js[1 ] isa AppRelativeResource
142
142
@test app_resources. js[1 ]. namespace == " dash_renderer"
143
143
@test app_resources. js[1 ]. relative_path == " path1.dev.js"
144
-
145
- @test app_resources. js[2 ] isa AppRelativeResource
144
+
145
+ @test app_resources. js[2 ] isa AppRelativeResource
146
146
@test app_resources. js[2 ]. namespace == " dash_renderer"
147
147
@test app_resources. js[2 ]. relative_path == " path2.dev.js"
148
-
149
- @test app_resources. js[end ] isa AppRelativeResource
148
+
149
+ @test app_resources. js[end ] isa AppRelativeResource
150
150
@test app_resources. js[end ]. namespace == " dash_renderer"
151
151
@test app_resources. js[end ]. relative_path == " dash-renderer/dash_renderer.dev.js"
152
152
@@ -162,13 +162,13 @@ end
162
162
@test length (app_resources. css) == 0
163
163
@test length (app_resources. js) == 3
164
164
165
- @test app_resources. js[1 ] isa AppExternalResource
165
+ @test app_resources. js[1 ] isa AppExternalResource
166
166
@test app_resources. js[1 ]. url == " external_path1.prod.js"
167
-
167
+
168
168
@test app_resources. js[2 ] isa AppExternalResource
169
169
@test app_resources. js[2 ]. url == " external_path2.prod.js"
170
-
171
- @test app_resources. js[end ] isa AppExternalResource
170
+
171
+ @test app_resources. js[end ] isa AppExternalResource
172
172
@test app_resources. js[end ]. url == " https://dash_renderer.min.js"
173
173
174
174
@test isempty (app_resources. files)
204
204
[
205
205
Resource (
206
206
relative_package_path = " dash-renderer/dash_renderer.min.js" ,
207
- external_url = " https://dash_renderer.min.js"
207
+ external_url = " https://dash_renderer.min.js"
208
208
),
209
209
Resource (
210
210
relative_package_path = " dash-renderer/dash_renderer.dyn.js" ,
216
216
external_url = " https://dash_renderer.eag.js" ,
217
217
async = :eager
218
218
)
219
-
219
+
220
220
]
221
- )
221
+ )
222
222
)
223
223
224
224
test_app = dash (include_assets_files = false )
@@ -227,14 +227,14 @@ end
227
227
@test length (app_resources. css) == 0
228
228
@test length (app_resources. js) == 2
229
229
@test app_resources. js[2 ]. relative_path == " dash-renderer/dash_renderer.min.js"
230
-
230
+
231
231
@test haskey (app_resources. files, " dash_renderer" )
232
232
@test app_resources. files[" dash_renderer" ]. base_path == " path"
233
233
@test " path1.prod.js" in app_resources. files[" dash_renderer" ]. files
234
234
@test " dash-renderer/dash_renderer.min.js" in app_resources. files[" dash_renderer" ]. files
235
235
@test " dash-renderer/dash_renderer.dyn.js" in app_resources. files[" dash_renderer" ]. files
236
236
@test " dash-renderer/dash_renderer.eag.js" in app_resources. files[" dash_renderer" ]. files
237
-
237
+
238
238
test_app = dash (eager_loading = true , include_assets_files = false )
239
239
240
240
app_resources = ApplicationResources (test_app, test_registry)
@@ -274,13 +274,13 @@ end
274
274
[
275
275
Resource (
276
276
relative_package_path = " dash-renderer/dash_renderer.min.js" ,
277
- external_url = " https://dash_renderer.min.js"
277
+ external_url = " https://dash_renderer.min.js"
278
278
),
279
279
]
280
- )
280
+ )
281
281
)
282
282
283
- register_package! (test_registry,
283
+ register_package! (test_registry,
284
284
ResourcePkg (
285
285
" comps" ,
286
286
" comps_path" ,
298
298
)
299
299
]
300
300
)
301
- )
301
+ )
302
302
303
303
test_app = dash (include_assets_files = false )
304
304
@@ -348,10 +348,10 @@ end
348
348
[
349
349
Resource (
350
350
relative_package_path = " dash-renderer/dash_renderer.min.js" ,
351
- external_url = " https://dash_renderer.min.js"
351
+ external_url = " https://dash_renderer.min.js"
352
352
),
353
353
]
354
- )
354
+ )
355
355
)
356
356
357
357
external_css = [" test.css" , Dict (" rel" => " stylesheet" , " href" => " test.css" )]
@@ -366,19 +366,19 @@ end
366
366
@test app_resources. js[end ]. relative_path == " dash-renderer/dash_renderer.min.js"
367
367
368
368
@test app_resources. css[1 ] isa AppExternalResource
369
- @test app_resources. css[1 ]. url == " test.css"
369
+ @test app_resources. css[1 ]. url == " test.css"
370
370
371
371
@test app_resources. css[2 ] isa AppCustomResource
372
- @test app_resources. css[2 ]. params[" href" ] == " test.css"
373
- @test app_resources. css[2 ]. params[" rel" ] == " stylesheet"
372
+ @test app_resources. css[2 ]. params[" href" ] == " test.css"
373
+ @test app_resources. css[2 ]. params[" rel" ] == " stylesheet"
374
374
375
375
@test app_resources. js[2 ] isa AppExternalResource
376
- @test app_resources. js[2 ]. url == " test.js"
377
-
376
+ @test app_resources. js[2 ]. url == " test.js"
377
+
378
378
@test app_resources. js[3 ] isa AppCustomResource
379
- @test app_resources. js[3 ]. params[" src" ] == " test.js"
380
- @test app_resources. js[3 ]. params[" crossorigin" ] == " anonymous"
381
-
379
+ @test app_resources. js[3 ]. params[" src" ] == " test.js"
380
+ @test app_resources. js[3 ]. params[" crossorigin" ] == " anonymous"
381
+
382
382
end
383
383
@testset " application resources assets" begin
384
384
test_registry = ResourcesRegistry (
@@ -401,15 +401,15 @@ end
401
401
" path" ,
402
402
[
403
403
]
404
- )
404
+ )
405
405
)
406
406
407
407
test_app = dash (assets_folder = " assets_include" )
408
408
409
409
app_resources = ApplicationResources (test_app, test_registry)
410
410
@test length (app_resources. css) == 1
411
411
@test length (app_resources. js) == 4
412
- @test app_resources. favicon == " favicon.ico"
412
+ @test app_resources. favicon. path == " favicon.ico"
413
413
@test all (app_resources. css) do r
414
414
r isa AppAssetResource
415
415
end
@@ -444,16 +444,16 @@ end
444
444
app_resources = ApplicationResources (test_app, test_registry)
445
445
@test length (app_resources. css) == 1
446
446
@test length (app_resources. js) == 4
447
- @test app_resources. favicon == " favicon.ico"
447
+ @test app_resources. favicon. path == " favicon.ico"
448
448
@test all (app_resources. css) do r
449
449
r isa AppAssetResource
450
450
end
451
451
@test app_resources. css[1 ]. path == " test.css"
452
-
452
+
453
453
@test all (app_resources. js) do r
454
454
r isa AppAssetResource
455
455
end
456
-
456
+
457
457
@test any (app_resources. js) do r
458
458
r. path == " test1.js"
459
459
end
@@ -472,18 +472,18 @@ end
472
472
app_resources = ApplicationResources (test_app, test_registry)
473
473
@test length (app_resources. css) == 1
474
474
@test length (app_resources. js) == 4
475
- @test app_resources. favicon == " favicon.ico"
475
+ @test app_resources. favicon. path == " favicon.ico"
476
476
477
477
@test all (app_resources. css) do r
478
478
r isa AppExternalResource
479
479
end
480
480
481
481
@test app_resources. css[1 ]. url == " http://ext/test.css"
482
-
482
+
483
483
@test all (app_resources. js) do r
484
484
r isa AppExternalResource
485
485
end
486
-
486
+
487
487
@test any (app_resources. js) do r
488
488
r. url == " http://ext/test1.js"
489
489
end
@@ -496,22 +496,22 @@ end
496
496
@test any (app_resources. js) do r
497
497
r. url == " http://ext/sub/sub2.js"
498
498
end
499
-
499
+
500
500
test_app = dash (assets_folder = " assets_include" , assets_ignore = " .*1" )
501
501
502
502
app_resources = ApplicationResources (test_app, test_registry)
503
503
@test length (app_resources. css) == 1
504
504
@test length (app_resources. js) == 2
505
- @test app_resources. favicon == " favicon.ico"
505
+ @test app_resources. favicon. path == " favicon.ico"
506
506
@test all (app_resources. css) do r
507
507
r isa AppAssetResource
508
508
end
509
509
@test app_resources. css[1 ]. path == " test.css"
510
-
510
+
511
511
@test all (app_resources. js) do r
512
512
r isa AppAssetResource
513
513
end
514
-
514
+
515
515
@test ! any (app_resources. js) do r
516
516
r. path == " test1.js"
517
517
end
0 commit comments