diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index d9c88eef..cb2d82ea 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -61,6 +61,10 @@ jobs: runs-on: ${{ matrix.os }} steps: + - name: Setup Git + if: matrix.os == 'windows-latest' + run: git config --global core.autocrlf input + - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} diff --git a/test/__snapshots__/prependData-option.test.js.snap b/test/__snapshots__/prependData-option.test.js.snap index b240559a..b6602137 100644 --- a/test/__snapshots__/prependData-option.test.js.snap +++ b/test/__snapshots__/prependData-option.test.js.snap @@ -1,5 +1,59 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`prependData option should use same EOL on all os (dart-sass) (sass): css 1`] = ` +"a { + color: hotpink; +} + +body { + color: hotpink; +}" +`; + +exports[`prependData option should use same EOL on all os (dart-sass) (sass): errors 1`] = `Array []`; + +exports[`prependData option should use same EOL on all os (dart-sass) (sass): warnings 1`] = `Array []`; + +exports[`prependData option should use same EOL on all os (dart-sass) (scss): css 1`] = ` +"a { + color: red; +} + +body { + color: hotpink; +}" +`; + +exports[`prependData option should use same EOL on all os (dart-sass) (scss): errors 1`] = `Array []`; + +exports[`prependData option should use same EOL on all os (dart-sass) (scss): warnings 1`] = `Array []`; + +exports[`prependData option should use same EOL on all os (node-sass) (sass): css 1`] = ` +"a { + color: hotpink; } + +body { + color: hotpink; } +" +`; + +exports[`prependData option should use same EOL on all os (node-sass) (sass): errors 1`] = `Array []`; + +exports[`prependData option should use same EOL on all os (node-sass) (sass): warnings 1`] = `Array []`; + +exports[`prependData option should use same EOL on all os (node-sass) (scss): css 1`] = ` +"a { + color: red; } + +body { + color: hotpink; } +" +`; + +exports[`prependData option should use same EOL on all os (node-sass) (scss): errors 1`] = `Array []`; + +exports[`prependData option should use same EOL on all os (node-sass) (scss): warnings 1`] = `Array []`; + exports[`prependData option should work with the "data" option as a function (dart-sass) (sass): css 1`] = ` "body { color: hotpink; diff --git a/test/prependData-option.test.js b/test/prependData-option.test.js index 05e83c6f..40ee5a2d 100644 --- a/test/prependData-option.test.js +++ b/test/prependData-option.test.js @@ -65,6 +65,30 @@ describe('prependData option', () => { expect(getWarnings(stats)).toMatchSnapshot('warnings'); expect(getErrors(stats)).toMatchSnapshot('errors'); }); + + it(`should use same EOL on all os (${implementationName}) (${syntax})`, async () => { + const testId = getTestId('prepending-data', syntax); + const prependData = + syntax === 'sass' + ? `$prepended-data: hotpink +a + color: $prepended-data` + : `$prepended-data: hotpink; +a { + color: red; +}`; + const options = { + implementation: getImplementationByName(implementationName), + prependData, + }; + const compiler = getCompiler(testId, { loader: { options } }); + const stats = await compile(compiler); + const codeFromBundle = getCodeFromBundle(stats, compiler); + + expect(codeFromBundle.css).toMatchSnapshot('css'); + expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(getErrors(stats)).toMatchSnapshot('errors'); + }); }); }); });