@@ -36,19 +36,21 @@ crosscheck(({ stable, oxide }) => {
3636
3737 oxide . test . todo ( 'should normalize extractors' )
3838 stable . test . each `
39- config
40- ${ { content : [ { raw : 'text-center' } ] , purge : { extract : ( ) => [ 'font-bold' ] } } }
41- ${ { content : [ { raw : 'text-center' } ] , purge : { extract : { DEFAULT : ( ) => [ 'font-bold' ] } } } }
42- ${ {
43- content : [ { raw : 'text-center' } ] ,
44- purge : { options : { defaultExtractor : ( ) => [ 'font-bold' ] } } ,
45- } }
46- ${ {
47- content : [ { raw : 'text-center' } ] ,
48- purge : { options : { extractors : [ { extractor : ( ) => [ 'font-bold' ] , extensions : [ 'html' ] } ] } } ,
49- } }
50- ${ { content : [ { raw : 'text-center' } ] , purge : { extract : { html : ( ) => [ 'font-bold' ] } } } }
51- ` ( 'should normalize extractors $config' , ( { config } ) => {
39+ config
40+ ${ { content : [ { raw : 'text-center' } ] , purge : { extract : ( ) => [ 'font-bold' ] } } }
41+ ${ { content : [ { raw : 'text-center' } ] , purge : { extract : { DEFAULT : ( ) => [ 'font-bold' ] } } } }
42+ ${ {
43+ content : [ { raw : 'text-center' } ] ,
44+ purge : { options : { defaultExtractor : ( ) => [ 'font-bold' ] } } ,
45+ } }
46+ ${ {
47+ content : [ { raw : 'text-center' } ] ,
48+ purge : {
49+ options : { extractors : [ { extractor : ( ) => [ 'font-bold' ] , extensions : [ 'html' ] } ] } ,
50+ } ,
51+ } }
52+ ${ { content : [ { raw : 'text-center' } ] , purge : { extract : { html : ( ) => [ 'font-bold' ] } } } }
53+ ` ( 'should normalize extractors $config' , ( { config } ) => {
5254 return run ( '@tailwind utilities' , config ) . then ( ( result ) => {
5355 return expect ( result . css ) . toMatchFormattedCss ( css `
5456 .font-bold {
@@ -111,12 +113,18 @@ crosscheck(({ stable, oxide }) => {
111113 content : [ './example-folder/**/*.{html,js}' ] ,
112114 }
113115
114- expect ( normalizeConfig ( resolveConfig ( config ) ) . content ) . toEqual ( {
116+ stable . expect ( normalizeConfig ( resolveConfig ( config ) ) . content ) . toEqual ( {
115117 files : [ './example-folder/**/*.{html,js}' ] ,
116118 relative : false ,
117119 extract : { } ,
118120 transform : { } ,
119121 } )
122+ oxide . expect ( normalizeConfig ( resolveConfig ( config ) ) . content ) . toEqual ( {
123+ files : [ './example-folder/**/*.{html,js}' ] ,
124+ relative : true ,
125+ extract : { } ,
126+ transform : { } ,
127+ } )
120128 } )
121129
122130 it ( 'should warn when we detect invalid globs with incorrect brace expansion' , ( ) => {
@@ -130,8 +138,10 @@ crosscheck(({ stable, oxide }) => {
130138 ] ,
131139 }
132140
141+ let normalizedConfig = normalizeConfig ( resolveConfig ( config ) ) . content
142+
133143 // No rewrite happens
134- expect ( normalizeConfig ( resolveConfig ( config ) ) . content ) . toEqual ( {
144+ stable . expect ( normalizedConfig ) . toEqual ( {
135145 files : [
136146 './{example-folder}/**/*.{html,js}' ,
137147 './{example-folder}/**/*.{html}' ,
@@ -141,6 +151,16 @@ crosscheck(({ stable, oxide }) => {
141151 extract : { } ,
142152 transform : { } ,
143153 } )
154+ oxide . expect ( normalizedConfig ) . toEqual ( {
155+ files : [
156+ './{example-folder}/**/*.{html,js}' ,
157+ './{example-folder}/**/*.{html}' ,
158+ './example-folder/**/*.{html}' ,
159+ ] ,
160+ relative : true ,
161+ extract : { } ,
162+ transform : { } ,
163+ } )
144164
145165 // But a warning should happen
146166 expect ( spy ) . toHaveBeenCalledTimes ( 2 )
0 commit comments