Skip to content

Commit c984ff4

Browse files
test: fix (#715)
1 parent cc01d2b commit c984ff4

File tree

6 files changed

+22
-23
lines changed

6 files changed

+22
-23
lines changed

package-lock.json

Lines changed: 10 additions & 11 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
@@ -60,7 +60,7 @@
6060
"cspell": "^9.6.2",
6161
"cssnano": "^7.1.2",
6262
"del": "^7.1.0",
63-
"del-cli": "^7.0.0",
63+
"del-cli": "^6.0.0",
6464
"eslint": "^9.32.0",
6565
"eslint-config-webpack": "^4.9.1",
6666
"husky": "^9.1.3",

test/__snapshots__/postcssOptions.test.js.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

33
exports[`"postcssOptions" option should throw an error with "syntax" option on the unresolved syntax: errors 1`] = `
44
[
@@ -500,7 +500,7 @@ exports[`"postcssOptions" option should work with the "config" options with "Str
500500
color: black
501501
}
502502
503-
/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlLnNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFO0FBREYiLCJmaWxlIjoic3R5bGUuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiYVxuICBjb2xvcjogYmxhY2tcbiJdfQ== */"
503+
/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlLnNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFO0FBREQiLCJmaWxlIjoic3R5bGUuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiYVxuICBjb2xvcjogYmxhY2tcbiJdfQ== */"
504504
`;
505505

506506
exports[`"postcssOptions" option should work with the "config" options with "String" value and respect all options: errors 1`] = `[]`;

test/__snapshots__/sourceMap.test.js.snap

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ exports[`"sourceMap" option should generate source maps when previous loader ret
162162
"a {
163163
color: coral;
164164
}
165-
"
165+
/*# sourceMappingURL=style.css.map */"
166166
`;
167167

168168
exports[`"sourceMap" option should generate source maps when previous loader returns source maps ("less-loader"): errors 1`] = `[]`;
@@ -173,12 +173,10 @@ exports[`"sourceMap" option should generate source maps when previous loader ret
173173
"names": [],
174174
"sourceRoot": "",
175175
"sources": [
176-
"less/style.less",
176+
"../../style.less",
177177
],
178178
"sourcesContent": [
179-
"a {
180-
color: coral;
181-
}
179+
"a { color: coral }
182180
",
183181
],
184182
"version": 3,

test/__snapshots__/validate-options.test.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

33
exports[`validate options should throw an error on the "execute" option with "/test/" value 1`] = `
44
"Invalid options object. PostCSS Loader has been initialized using an options object that does not match the API schema.

test/sourceMap.test.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,9 +432,11 @@ describe('"sourceMap" option', () => {
432432
sourceMap.sources = sourceMap.sources.map((source) => {
433433
expect(path.isAbsolute(source)).toBe(true);
434434
expect(source).toBe(path.normalize(source));
435-
expect(fs.existsSync(path.resolve(sourceMap.sourceRoot, source))).toBe(
436-
true,
437-
);
435+
expect(
436+
fs.existsSync(
437+
path.resolve(__dirname, "./fixtures/less", path.basename(source)),
438+
),
439+
).toBe(true);
438440

439441
return path
440442
.relative(path.resolve(__dirname, "./fixtures"), source)

0 commit comments

Comments
 (0)