Skip to content

Commit a17e977

Browse files
committed
fix: STRF-13766 Update node sass version with minor fix
1 parent b4b9726 commit a17e977

5 files changed

Lines changed: 83 additions & 75 deletions

File tree

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20
1+
22

lib/ScssCompiler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class ScssCompiler {
7676
};
7777
const result = await this._render(engineOptions);
7878
this.files = {};
79-
return result.css;
79+
return result.css.toString();
8080
}
8181

8282
/**

package-lock.json

Lines changed: 65 additions & 68 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828
"lib/"
2929
],
3030
"dependencies": {
31+
"@bigcommerce/node-sass": "10.0.1",
3132
"async": "^3.2.6",
3233
"autoprefixer": "^10.4.20",
3334
"cheerio": "^1.0.0-rc.12",
3435
"lodash": "^4.17.21",
35-
"@bigcommerce/node-sass": "10.0.0",
3636
"postcss": "^8.4.45",
3737
"recursive-readdir": "^2.2.3",
3838
"sass": "^1.58.0",

test/ScssCompiler.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,22 @@ describe('ScssCompiler', () => {
116116
});
117117

118118
it('should return the compiled css from the primary engine when it finishes successfully', async () => {
119-
const scssCompiler = createScssCompiler()
120-
121-
const result = await scssCompiler.compile(getOptionsMock());
119+
const scssCompiler = new ScssCompiler(console);
120+
scssCompiler.activateNodeSassEngine();
121+
const files = {
122+
'theme.scss': '@import "tools/tools";\n@import "tools/onemore";\n\nh1 {\n color: #0000AA;\n}\n\n$font: "Arial";',
123+
'tools/tools.scss': '.tools {\n color: red;\n}',
124+
'tools/onemore.scss': '.underscore {\n color: green;\n}',
125+
};
126+
const result = await scssCompiler.compile({
127+
data: files['theme.scss'],
128+
files,
129+
dest: `/assets/css/theme.scss`,
130+
themeSettings: { ...themeSettingsMock },
131+
autoprefixerOptions: {},
132+
});
122133

123-
expect(result).to.equal(getRenderResultMock().css);
134+
expect(result).to.equal(".tools {\n color: red; }\n\n.underscore {\n color: green; }\n\nh1 {\n color: #0000AA; }\n");
124135
});
125136
});
126137

0 commit comments

Comments
 (0)