Skip to content

Commit 3d19561

Browse files
test: update
1 parent 0714f7d commit 3d19561

File tree

3 files changed

+8
-19
lines changed

3 files changed

+8
-19
lines changed

test/__snapshots__/loader.test.js.snap

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@ Array [
1818
"message": "My warning message",
1919
"type": "warn",
2020
},
21-
Object {
22-
"message": "My debug message",
23-
"type": "debug",
24-
},
25-
Object {
26-
"message": "My warning message",
27-
"type": "warn",
28-
},
2921
]
3022
`;
3123

@@ -49,14 +41,6 @@ Array [
4941
"message": "My warning message",
5042
"type": "warn",
5143
},
52-
Object {
53-
"message": "My debug message",
54-
"type": "debug",
55-
},
56-
Object {
57-
"message": "My warning message",
58-
"type": "warn",
59-
},
6044
]
6145
`;
6246

@@ -1401,7 +1385,7 @@ Array [
14011385
Array [
14021386
Object {
14031387
"args": Array [
1404-
"file:///home/evilebottnawi/IdeaProjects/sass-loader/test/sass/logging.sass:0:0: My debug message",
1388+
"file:///<cwd>/sass/logging.sass:0:0: My debug message",
14051389
],
14061390
"type": "debug",
14071391
},
@@ -1433,7 +1417,7 @@ Array [
14331417
Array [
14341418
Object {
14351419
"args": Array [
1436-
"file:///home/evilebottnawi/IdeaProjects/sass-loader/test/scss/logging.scss:0:0: My debug message",
1420+
"file:///<cwd>/scss/logging.scss:0:0: My debug message",
14371421
],
14381422
"type": "debug",
14391423
},

test/helpers/getCodeFromSass.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,8 @@ function getCodeFromSass(testId, options) {
781781
.concat([testImporter])
782782
: [testImporter];
783783

784+
sassOptions.logger = { debug: () => {}, warn: () => {} };
785+
784786
const { css, map } = implementation.renderSync(sassOptions);
785787

786788
return { css: css.toString(), sourceMap: map };

test/loader.test.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import path from "path";
2+
import url from "url";
23

34
import nodeSass from "node-sass";
45
import dartSass from "sass";
@@ -1755,7 +1756,9 @@ describe("loader", () => {
17551756
value.map((item) => {
17561757
return {
17571758
type: item.type,
1758-
args: item.args,
1759+
args: item.args.map((arg) =>
1760+
arg.replace(url.pathToFileURL(__dirname), "file:///<cwd>")
1761+
),
17591762
};
17601763
})
17611764
);

0 commit comments

Comments
 (0)