@@ -98,6 +98,60 @@ describe('Converter', function() {
98
98
} ) ;
99
99
} ) ;
100
100
101
+ describe ( 'Converter with categorizeByGroup=false' , function ( ) {
102
+ const base = Path . join ( __dirname , 'converter' ) ;
103
+ const categoryDir = Path . join ( base , 'category' ) ;
104
+ const classDir = Path . join ( base , 'class' ) ;
105
+ let app : Application ;
106
+
107
+ before ( 'constructs' , function ( ) {
108
+ app = new Application ( {
109
+ mode : 'Modules' ,
110
+ logger : 'none' ,
111
+ target : 'ES5' ,
112
+ module : 'CommonJS' ,
113
+ experimentalDecorators : true ,
114
+ categorizeByGroup : false ,
115
+ jsx : 'react'
116
+ } ) ;
117
+ } ) ;
118
+
119
+ let result : ProjectReflection | undefined ;
120
+
121
+ describe ( 'category' , ( ) => {
122
+ it ( 'converts fixtures' , function ( ) {
123
+ resetReflectionID ( ) ;
124
+ result = app . convert ( app . expandInputFiles ( [ categoryDir ] ) ) ;
125
+ Assert ( result instanceof ProjectReflection , 'No reflection returned' ) ;
126
+ } ) ;
127
+
128
+ it ( 'matches specs' , function ( ) {
129
+ const specs = JSON . parse ( FS . readFileSync ( Path . join ( categoryDir , 'specs-with-lump-categories.json' ) ) . toString ( ) ) ;
130
+ let data = JSON . stringify ( result ! . toObject ( ) , null , ' ' ) ;
131
+ data = data . split ( normalizePath ( base ) ) . join ( '%BASE%' ) ;
132
+
133
+ compareReflections ( JSON . parse ( data ) , specs ) ;
134
+ } ) ;
135
+ } ) ;
136
+
137
+ // verify that no categories are used when not specified during lump categorization
138
+ describe ( 'class' , ( ) => {
139
+ it ( 'converts fixtures' , function ( ) {
140
+ resetReflectionID ( ) ;
141
+ result = app . convert ( app . expandInputFiles ( [ classDir ] ) ) ;
142
+ Assert ( result instanceof ProjectReflection , 'No reflection returned' ) ;
143
+ } ) ;
144
+
145
+ it ( 'matches specs' , function ( ) {
146
+ const specs = JSON . parse ( FS . readFileSync ( Path . join ( classDir , 'specs.json' ) ) . toString ( ) ) ;
147
+ let data = JSON . stringify ( result ! . toObject ( ) , null , ' ' ) ;
148
+ data = data . split ( normalizePath ( base ) ) . join ( '%BASE%' ) ;
149
+
150
+ compareReflections ( JSON . parse ( data ) , specs ) ;
151
+ } ) ;
152
+ } ) ;
153
+ } ) ;
154
+
101
155
describe ( 'Converter with excludeNotExported=true' , function ( ) {
102
156
const base = Path . join ( __dirname , 'converter' ) ;
103
157
const exportWithLocalDir = Path . join ( base , 'export-with-local' ) ;
0 commit comments