@@ -32,7 +32,7 @@ export class AnalysisTests {
32
32
@test "can add styles from a block" ( ) {
33
33
let config = resolveConfiguration ( { } ) ;
34
34
let info = new Template ( "templates/my-template.hbs" ) ;
35
- let analyzer = new TestAnalyzer ( ) ;
35
+ let analyzer = new TestAnalyzer ( new BlockFactory ( config ) ) ;
36
36
let analysis = analyzer . newAnalysis ( info ) ;
37
37
let css = `
38
38
:scope { color: blue; }
@@ -64,7 +64,7 @@ export class AnalysisTests {
64
64
@test "can add dynamic styles from a block" ( ) {
65
65
let config = resolveConfiguration ( { } ) ;
66
66
let info = new Template ( "templates/my-template.hbs" ) ;
67
- let analyzer = new TestAnalyzer ( ) ;
67
+ let analyzer = new TestAnalyzer ( new BlockFactory ( config ) ) ;
68
68
let analysis = analyzer . newAnalysis ( info ) ;
69
69
let css = `
70
70
:scope { color: blue; }
@@ -98,7 +98,7 @@ export class AnalysisTests {
98
98
@test "can correlate styles" ( ) {
99
99
let config = resolveConfiguration ( { } ) ;
100
100
let info = new Template ( "templates/my-template.hbs" ) ;
101
- let analyzer = new TestAnalyzer ( ) ;
101
+ let analyzer = new TestAnalyzer ( new BlockFactory ( config ) ) ;
102
102
let analysis = analyzer . newAnalysis ( info ) ;
103
103
let css = `
104
104
:scope { color: blue; }
@@ -139,7 +139,7 @@ export class AnalysisTests {
139
139
@test "can add styles from two blocks" ( ) {
140
140
let config = resolveConfiguration ( { } ) ;
141
141
let info = new Template ( "templates/my-template.hbs" ) ;
142
- let analyzer = new TestAnalyzer ( ) ;
142
+ let analyzer = new TestAnalyzer ( new BlockFactory ( config ) ) ;
143
143
let analysis = analyzer . newAnalysis ( info ) ;
144
144
let css = `
145
145
:scope { color: blue; }
@@ -183,7 +183,7 @@ export class AnalysisTests {
183
183
184
184
@test "adding dynamic styles enumerates correlation in analysis" ( ) {
185
185
let info = new Template ( "templates/my-template.hbs" ) ;
186
- let analyzer = new TestAnalyzer ( ) ;
186
+ let analyzer = new TestAnalyzer ( new BlockFactory ( { } ) ) ;
187
187
let analysis = analyzer . newAnalysis ( info ) ;
188
188
let { imports, config } = setupImporting ( ) ;
189
189
@@ -234,7 +234,7 @@ export class AnalysisTests {
234
234
235
235
@test "multiple dynamic values added using `addExclusiveStyles` enumerate correlations correctly in analysis" ( ) {
236
236
let info = new Template ( "templates/my-template.hbs" ) ;
237
- let analyzer = new TestAnalyzer ( ) ;
237
+ let analyzer = new TestAnalyzer ( new BlockFactory ( { } ) ) ;
238
238
let analysis = analyzer . newAnalysis ( info ) ;
239
239
let { config } = setupImporting ( ) ;
240
240
@@ -273,7 +273,7 @@ export class AnalysisTests {
273
273
274
274
@test "multiple exclusive dynamic values added using enumerate correlations correctly in analysis" ( ) {
275
275
let info = new Template ( "templates/my-template.hbs" ) ;
276
- let analyzer = new TestAnalyzer ( ) ;
276
+ let analyzer = new TestAnalyzer ( new BlockFactory ( { } ) ) ;
277
277
let analysis = analyzer . newAnalysis ( info ) ;
278
278
let { config } = setupImporting ( ) ;
279
279
@@ -338,7 +338,7 @@ export class AnalysisTests {
338
338
339
339
@test "toggling between two classes with states of the same name" ( ) {
340
340
let info = new Template ( "templates/my-template.hbs" ) ;
341
- let analyzer = new TestAnalyzer ( ) ;
341
+ let analyzer = new TestAnalyzer ( new BlockFactory ( { } ) ) ;
342
342
let analysis = analyzer . newAnalysis ( info ) ;
343
343
let { imports, config } = setupImporting ( ) ;
344
344
@@ -392,7 +392,7 @@ export class AnalysisTests {
392
392
393
393
@test "addExclusiveStyles generates correct correlations when `alwaysPresent` is true" ( ) {
394
394
let info = new Template ( "templates/my-template.hbs" ) ;
395
- let analyzer = new TestAnalyzer ( ) ;
395
+ let analyzer = new TestAnalyzer ( new BlockFactory ( { } ) ) ;
396
396
let analysis = analyzer . newAnalysis ( info ) ;
397
397
let { imports, config } = setupImporting ( ) ;
398
398
imports . registerSource (
@@ -442,7 +442,7 @@ export class AnalysisTests {
442
442
443
443
@test "addExclusiveStyles generates correct correlations when `alwaysPresent` is false" ( ) {
444
444
let info = new Template ( "templates/my-template.hbs" ) ;
445
- let analyzer = new TestAnalyzer ( ) ;
445
+ let analyzer = new TestAnalyzer ( new BlockFactory ( { } ) ) ;
446
446
let analysis = analyzer . newAnalysis ( info ) ;
447
447
let { imports, config } = setupImporting ( ) ;
448
448
imports . registerSource (
@@ -488,7 +488,7 @@ export class AnalysisTests {
488
488
}
489
489
@test "can generate an analysis for the optimizer" ( ) {
490
490
let info = new Template ( "templates/my-template.hbs" ) ;
491
- let analyzer = new TestAnalyzer ( ) ;
491
+ let analyzer = new TestAnalyzer ( new BlockFactory ( { } ) ) ;
492
492
let analysis = analyzer . newAnalysis ( info ) ;
493
493
let { imports, config } = setupImporting ( ) ;
494
494
imports . registerSource (
@@ -563,9 +563,9 @@ export class AnalysisTests {
563
563
564
564
@test "correlating two classes from the same block on the same element throws an error" ( ) {
565
565
let info = new Template ( "templates/my-template.hbs" ) ;
566
- let analyzer = new TestAnalyzer ( ) ;
567
- let analysis = analyzer . newAnalysis ( info ) ;
568
566
let config = resolveConfiguration ( { } ) ;
567
+ let analyzer = new TestAnalyzer ( new BlockFactory ( config ) ) ;
568
+ let analysis = analyzer . newAnalysis ( info ) ;
569
569
570
570
let css = `
571
571
:scope { color: blue; }
@@ -590,9 +590,10 @@ export class AnalysisTests {
590
590
591
591
@test "built-in template validators may be configured with boolean values" ( ) {
592
592
let info = new Template ( "templates/my-template.hbs" ) ;
593
- let analyzer = new TestAnalyzer ( { } , { validations : { "no-class-pairs" : false } } ) ;
594
- let analysis = analyzer . newAnalysis ( info ) ;
595
593
let config = resolveConfiguration ( { } ) ;
594
+ let blockFactory = new BlockFactory ( config ) ;
595
+ let analyzer = new TestAnalyzer ( blockFactory , { validations : { "no-class-pairs" : false } } ) ;
596
+ let analysis = analyzer . newAnalysis ( info ) ;
596
597
597
598
let css = `
598
599
:scope { color: blue; }
@@ -613,9 +614,9 @@ export class AnalysisTests {
613
614
614
615
@test "custom template validators may be passed to analysis" ( ) {
615
616
let info = new Template ( "templates/my-template.hbs" ) ;
616
- let analyzer = new TestAnalyzer ( { } , { validations : { customValidator ( data , _a , err ) { if ( data ) err ( "CUSTOM ERROR" ) ; } } } ) ;
617
- let analysis = analyzer . newAnalysis ( info ) ;
618
617
let config = resolveConfiguration ( { } ) ;
618
+ let analyzer = new TestAnalyzer ( new BlockFactory ( config ) , { validations : { customValidator ( data , _a , err ) { if ( data ) err ( "CUSTOM ERROR" ) ; } } } ) ;
619
+ let analysis = analyzer . newAnalysis ( info ) ;
619
620
620
621
let css = `
621
622
:scope { color: blue; }
@@ -633,9 +634,9 @@ export class AnalysisTests {
633
634
634
635
@test "adding both root and a class from the same block to the same elment throws an error" ( ) {
635
636
let info = new Template ( "templates/my-template.hbs" ) ;
636
- let analyzer = new TestAnalyzer ( ) ;
637
- let analysis = analyzer . newAnalysis ( info ) ;
638
637
let config = resolveConfiguration ( { } ) ;
638
+ let analyzer = new TestAnalyzer ( new BlockFactory ( config ) ) ;
639
+ let analysis = analyzer . newAnalysis ( info ) ;
639
640
640
641
let css = `
641
642
:scope { color: blue; }
@@ -661,9 +662,9 @@ export class AnalysisTests {
661
662
662
663
@test "adding both root and a state from the same block to the same element is allowed" ( ) {
663
664
let info = new Template ( "templates/my-template.hbs" ) ;
664
- let analyzer = new TestAnalyzer ( ) ;
665
- let analysis = analyzer . newAnalysis ( info ) ;
666
665
let config = resolveConfiguration ( { } ) ;
666
+ let analyzer = new TestAnalyzer ( new BlockFactory ( config ) ) ;
667
+ let analysis = analyzer . newAnalysis ( info ) ;
667
668
668
669
let css = `
669
670
:scope { color: blue; }
@@ -685,7 +686,7 @@ export class AnalysisTests {
685
686
686
687
@test "classes from other blocks may be added to the root element" ( ) {
687
688
let info = new Template ( "templates/my-template.hbs" ) ;
688
- let analyzer = new TestAnalyzer ( ) ;
689
+ let analyzer = new TestAnalyzer ( new BlockFactory ( { } ) ) ;
689
690
let analysis = analyzer . newAnalysis ( info ) ;
690
691
let { imports, config } = setupImporting ( ) ;
691
692
@@ -733,7 +734,7 @@ export class AnalysisTests {
733
734
734
735
@test "throws when states are applied without their parent root" ( ) {
735
736
let info = new Template ( "templates/my-template.hbs" ) ;
736
- let analyzer = new TestAnalyzer ( ) ;
737
+ let analyzer = new TestAnalyzer ( new BlockFactory ( { } ) ) ;
737
738
let analysis = analyzer . newAnalysis ( info ) ;
738
739
let { config } = setupImporting ( ) ;
739
740
@@ -755,7 +756,7 @@ export class AnalysisTests {
755
756
756
757
@test "throws when states are applied without their parent BlockClass" ( ) {
757
758
let info = new Template ( "templates/my-template.hbs" ) ;
758
- let analyzer = new TestAnalyzer ( ) ;
759
+ let analyzer = new TestAnalyzer ( new BlockFactory ( { } ) ) ;
759
760
let analysis = analyzer . newAnalysis ( info ) ;
760
761
let { config } = setupImporting ( ) ;
761
762
@@ -780,7 +781,7 @@ export class AnalysisTests {
780
781
781
782
@test "Throws when inherited states are applied without their root" ( ) {
782
783
let info = new Template ( "templates/my-template.hbs" ) ;
783
- let analyzer = new TestAnalyzer ( ) ;
784
+ let analyzer = new TestAnalyzer ( new BlockFactory ( { } ) ) ;
784
785
let analysis = analyzer . newAnalysis ( info ) ;
785
786
let { imports, config } = setupImporting ( ) ;
786
787
@@ -822,7 +823,7 @@ export class AnalysisTests {
822
823
823
824
@test "Inherited states pass validation when applied with their root" ( ) {
824
825
let info = new Template ( "templates/my-template.hbs" ) ;
825
- let analyzer = new TestAnalyzer ( ) ;
826
+ let analyzer = new TestAnalyzer ( new BlockFactory ( { } ) ) ;
826
827
let analysis = analyzer . newAnalysis ( info ) ;
827
828
let { imports, config } = setupImporting ( ) ;
828
829
@@ -863,7 +864,7 @@ export class AnalysisTests {
863
864
864
865
@test "composition test" ( ) {
865
866
let info = new Template ( "templates/my-template.hbs" ) ;
866
- let analyzer = new TestAnalyzer ( ) ;
867
+ let analyzer = new TestAnalyzer ( new BlockFactory ( { } ) ) ;
867
868
let analysis = analyzer . newAnalysis ( info ) ;
868
869
let { imports, config } = setupImporting ( ) ;
869
870
0 commit comments