@@ -50,6 +50,7 @@ test('returns error when input file cannot be read', async () => {
5050 showProgress : false ,
5151 shouldStream : false ,
5252 unsafeFakerExpressions : false ,
53+ pairwise : false ,
5354 } ,
5455 } ) ;
5556 expect ( code ) . toBe ( 1 ) ;
@@ -69,6 +70,7 @@ test('writes output file in buffered mode', async () => {
6970 showProgress : false ,
7071 shouldStream : false ,
7172 unsafeFakerExpressions : false ,
73+ pairwise : false ,
7274 } ,
7375 } ) ;
7476 expect ( code ) . toBe ( 0 ) ;
@@ -96,9 +98,81 @@ test('returns error when stream writer fails', async () => {
9698 showProgress : false ,
9799 shouldStream : true ,
98100 unsafeFakerExpressions : false ,
101+ pairwise : false ,
99102 } ,
100103 } ) ;
101104
102105 expect ( code ) . toBe ( 1 ) ;
103106 expect ( platform . err . join ( '' ) ) . toContain ( 'Streaming generation failed' ) ;
104107} ) ;
108+
109+ test ( 'ignores stream mode when pairwise is requested' , async ( ) => {
110+ const platform = makePlatform ( { textSpec : 'Browser\nChrome,Firefox,Safari\nTheme\nLight,Dark' } ) ;
111+ const code = await runCliCommand ( {
112+ platform,
113+ options : {
114+ inputFile : 'spec.txt' ,
115+ outputFile : 'out.csv' ,
116+ format : 'csv' ,
117+ rowCount : 2 ,
118+ testMode : false ,
119+ showProgress : false ,
120+ shouldStream : true ,
121+ unsafeFakerExpressions : false ,
122+ pairwise : true ,
123+ } ,
124+ } ) ;
125+ expect ( code ) . toBe ( 0 ) ;
126+ expect ( platform . err . join ( '' ) ) . toBe ( '' ) ;
127+ expect ( platform . writes . length ) . toBe ( 1 ) ;
128+ expect ( platform . writes [ 0 ] . path ) . toBe ( 'out.csv' ) ;
129+ } ) ;
130+
131+ test ( 'reports warning in test mode when stream mode is ignored for pairwise' , async ( ) => {
132+ const platform = makePlatform ( { textSpec : 'Browser\nChrome,Firefox,Safari\nTheme\nLight,Dark' } ) ;
133+ const code = await runCliCommand ( {
134+ platform,
135+ options : {
136+ inputFile : 'spec.txt' ,
137+ outputFile : 'out.csv' ,
138+ format : 'csv' ,
139+ rowCount : 2 ,
140+ testMode : true ,
141+ showProgress : true ,
142+ shouldStream : true ,
143+ unsafeFakerExpressions : false ,
144+ pairwise : true ,
145+ } ,
146+ } ) ;
147+ expect ( code ) . toBe ( 0 ) ;
148+ expect ( platform . out . join ( '' ) ) . toContain ( 'WARNING: Streaming is ignored when pairwise generation is enabled' ) ;
149+ } ) ;
150+
151+ test ( 'generates deterministic pairwise output in buffered mode' , async ( ) => {
152+ const platform = makePlatform ( { textSpec : 'Browser\nChrome,Firefox,Safari\nTheme\nLight,Dark' } ) ;
153+ const code = await runCliCommand ( {
154+ platform,
155+ options : {
156+ inputFile : 'spec.txt' ,
157+ outputFile : null ,
158+ format : 'json' ,
159+ rowCount : 100 ,
160+ testMode : false ,
161+ showProgress : false ,
162+ shouldStream : false ,
163+ unsafeFakerExpressions : false ,
164+ pairwise : true ,
165+ } ,
166+ } ) ;
167+
168+ expect ( code ) . toBe ( 0 ) ;
169+ const rendered = platform . out . join ( '' ) . trim ( ) ;
170+ expect ( JSON . parse ( rendered ) ) . toEqual ( [
171+ { Browser : 'Chrome' , Theme : 'Light' } ,
172+ { Browser : 'Chrome' , Theme : 'Dark' } ,
173+ { Browser : 'Firefox' , Theme : 'Light' } ,
174+ { Browser : 'Firefox' , Theme : 'Dark' } ,
175+ { Browser : 'Safari' , Theme : 'Light' } ,
176+ { Browser : 'Safari' , Theme : 'Dark' } ,
177+ ] ) ;
178+ } ) ;
0 commit comments