@@ -838,4 +838,43 @@ describe("loader", () => {
838838 expect ( getWarnings ( stats ) ) . toMatchSnapshot ( "warnings" ) ;
839839 expect ( getErrors ( stats ) ) . toMatchSnapshot ( "errors" ) ;
840840 } ) ;
841+
842+ // TODO bug on windows
843+ it . skip ( "should work with circular imports" , async ( ) => {
844+ const testId = "./circular.less" ;
845+ const compiler = getCompiler ( testId ) ;
846+ const stats = await compile ( compiler ) ;
847+ const codeFromBundle = getCodeFromBundle ( stats , compiler ) ;
848+ const codeFromLess = await getCodeFromLess ( testId ) ;
849+
850+ expect ( codeFromBundle . css ) . toBe ( codeFromLess . css ) ;
851+ expect ( codeFromBundle . css ) . toMatchSnapshot ( "css" ) ;
852+ expect ( getWarnings ( stats ) ) . toMatchSnapshot ( "warnings" ) ;
853+ expect ( getErrors ( stats ) ) . toMatchSnapshot ( "errors" ) ;
854+ } ) ;
855+
856+ it ( "should work and respect the 'resolve.byDependecy.less' option" , async ( ) => {
857+ const testId = "./by-dependency.less" ;
858+ const compiler = getCompiler (
859+ testId ,
860+ { } ,
861+ {
862+ resolve : {
863+ byDependency : {
864+ less : {
865+ mainFiles : [ "custom" ] ,
866+ } ,
867+ } ,
868+ } ,
869+ }
870+ ) ;
871+ const stats = await compile ( compiler ) ;
872+ const codeFromBundle = getCodeFromBundle ( stats , compiler ) ;
873+ const codeFromLess = await getCodeFromLess ( testId ) ;
874+
875+ expect ( codeFromBundle . css ) . toBe ( codeFromLess . css ) ;
876+ expect ( codeFromBundle . css ) . toMatchSnapshot ( "css" ) ;
877+ expect ( getWarnings ( stats ) ) . toMatchSnapshot ( "warnings" ) ;
878+ expect ( getErrors ( stats ) ) . toMatchSnapshot ( "errors" ) ;
879+ } ) ;
841880} ) ;
0 commit comments