@@ -18,7 +18,6 @@ Object.keys( pipelines ).forEach( dirname => {
1818 describe ( dirname , ( ) => {
1919 let testDir = path . join ( __dirname , dirname )
2020 fs . readdirSync ( testDir ) . forEach ( testCase => {
21- if ( testCase !== 'aliases' ) return
2221 if ( fs . existsSync ( path . join ( testDir , testCase , "source.css" ) ) ) {
2322 it ( "should " + testCase . replace ( / - / g, " " ) , done => {
2423 let expected = normalize ( fs . readFileSync ( path . join ( testDir , testCase , "expected.css" ) , "utf-8" ) )
@@ -35,22 +34,22 @@ Object.keys( pipelines ).forEach( dirname => {
3534} )
3635
3736// special case for testing multiple sources
38- // describe( 'multiple sources', () => {
39- // let testDir = path.join( __dirname, 'test-cases' )
40- // let testCase = 'multiple-sources';
41- // let dirname = 'test-cases';
42- // if ( fs.existsSync( path.join( testDir, testCase, "source1.css" ) ) ) {
43- // it( "should " + testCase.replace( /-/g, " " ), done => {
44- // let expected = normalize( fs.readFileSync( path.join( testDir, testCase, "expected.css" ), "utf-8" ) )
45- // let loader = new FileSystemLoader( testDir, pipelines[dirname] )
46- // let expectedTokens = JSON.parse( fs.readFileSync( path.join( testDir, testCase, "expected.json" ), "utf-8" ) )
47- // loader.fetch( `${testCase}/source1.css`, "/" ).then( tokens1 => {
48- // loader.fetch( `${testCase}/source2.css`, "/" ).then( tokens2 => {
49- // assert.equal( loader.finalSource, expected )
50- // const tokens = Object.assign({}, tokens1, tokens2);
51- // assert.equal( JSON.stringify( tokens ), JSON.stringify( expectedTokens ) )
52- // } ).then( done, done )
53- // })
54- // } );
55- // }
56- // } );
37+ describe ( 'multiple sources' , ( ) => {
38+ let testDir = path . join ( __dirname , 'test-cases' )
39+ let testCase = 'multiple-sources' ;
40+ let dirname = 'test-cases' ;
41+ if ( fs . existsSync ( path . join ( testDir , testCase , "source1.css" ) ) ) {
42+ it ( "should " + testCase . replace ( / - / g, " " ) , done => {
43+ let expected = normalize ( fs . readFileSync ( path . join ( testDir , testCase , "expected.css" ) , "utf-8" ) )
44+ let loader = new FileSystemLoader ( testDir , pipelines [ dirname ] )
45+ let expectedTokens = JSON . parse ( fs . readFileSync ( path . join ( testDir , testCase , "expected.json" ) , "utf-8" ) )
46+ loader . fetch ( `${ testCase } /source1.css` , "/" ) . then ( tokens1 => {
47+ loader . fetch ( `${ testCase } /source2.css` , "/" ) . then ( tokens2 => {
48+ assert . equal ( loader . finalSource , expected )
49+ const tokens = Object . assign ( { } , tokens1 , tokens2 ) ;
50+ assert . equal ( JSON . stringify ( tokens ) , JSON . stringify ( expectedTokens ) )
51+ } ) . then ( done , done )
52+ } )
53+ } ) ;
54+ }
55+ } ) ;
0 commit comments