@@ -655,6 +655,39 @@ describe('loader', () => {
655
655
expect ( getErrors ( stats ) ) . toMatchSnapshot ( 'errors' ) ;
656
656
} ) ;
657
657
658
+ it ( `should respect the "SASS_PATH" environment variable (${ implementationName } ) (${ syntax } )` , async ( ) => {
659
+ const OLD_SASS_PATH = process . env . SASS_PATH ;
660
+
661
+ process . env . SASS_PATH =
662
+ process . platform === 'win32'
663
+ ? `${ path . resolve ( 'test' , syntax , 'sass_path' ) } ;${ path . resolve (
664
+ 'test' ,
665
+ syntax ,
666
+ 'sass_path_other'
667
+ ) } `
668
+ : `${ path . resolve ( 'test' , syntax , 'sass_path' ) } :${ path . resolve (
669
+ 'test' ,
670
+ syntax ,
671
+ 'sass_path_other'
672
+ ) } `;
673
+
674
+ const testId = getTestId ( 'sass_path-env' , syntax ) ;
675
+ const options = {
676
+ implementation : getImplementationByName ( implementationName ) ,
677
+ } ;
678
+ const compiler = getCompiler ( testId , { loader : { options } } ) ;
679
+ const stats = await compile ( compiler ) ;
680
+ const codeFromBundle = getCodeFromBundle ( stats , compiler ) ;
681
+ const codeFromSass = getCodeFromSass ( testId , options ) ;
682
+
683
+ expect ( codeFromBundle . css ) . toBe ( codeFromSass . css ) ;
684
+ expect ( codeFromBundle . css ) . toMatchSnapshot ( 'css' ) ;
685
+ expect ( getWarnings ( stats ) ) . toMatchSnapshot ( 'warnings' ) ;
686
+ expect ( getErrors ( stats ) ) . toMatchSnapshot ( 'errors' ) ;
687
+
688
+ process . env . SASS_PATH = OLD_SASS_PATH ;
689
+ } ) ;
690
+
658
691
if ( implementation === dartSass ) {
659
692
it ( `should output an understandable error with a problem in "@use" (${ implementationName } ) (${ syntax } )` , async ( ) => {
660
693
const testId = getTestId ( 'error-use' , syntax ) ;
0 commit comments