Skip to content

Commit 51f866f

Browse files
committed
test: failing test cases
1 parent c13f369 commit 51f866f

File tree

4 files changed

+28
-3
lines changed

4 files changed

+28
-3
lines changed

test/__snapshots__/loader.test.js.snap

+15-1
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ Array [
675675
"",
676676
],
677677
Array [
678-
"plain.scss!=!../../src/index.js?[ident]!./index-loader-syntax-sass.css",
678+
"button.modules.css!=!./index-loader-syntax-sass.css",
679679
".baz {
680680
width: 5px;
681681
}",
@@ -733,6 +733,20 @@ Array [
733733
"./index-loader-syntax.css",
734734
".a {
735735
color: red;
736+
}",
737+
"",
738+
],
739+
Array [
740+
"button.modules.css!=!./index-loader-syntax-sass.css",
741+
".baz {
742+
width: 5px;
743+
}",
744+
"",
745+
],
746+
Array [
747+
"button.module.scss!=!./base64-loader/index.js?[ident]!./simple.js",
748+
".foo {
749+
color: red;
736750
}",
737751
"",
738752
],

test/fixtures/base64-loader/index.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = function loader(content) {
2+
console.log(Buffer.from(this.query.slice(1), 'base64').toString('ascii'))
3+
return Buffer.from(this.query.slice(1), 'base64').toString('ascii');
4+
};

test/fixtures/index-loader-syntax.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
import css from './index-loader-syntax.css';
22

3-
__export__ = css;
3+
import styles from 'button.modules.css!=!./index-loader-syntax-sass.css'
44

5-
export default css;
5+
// the base64 decodes to ".foo { color: red; }"
6+
import styles2 from './button.module.scss!=!./base64-loader?LmZvbyB7IGNvbG9yOiByZWQ7IH0=!./simple.js'
7+
8+
9+
__export__ = [...css, ...styles, ...styles2];
10+
11+
export default css;

test/loader.test.js

+1
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,7 @@ describe("loader", () => {
553553
expect(getModuleSource("./index-loader-syntax.css", stats)).toMatchSnapshot(
554554
"module"
555555
);
556+
556557
expect(getExecutedCode("main.bundle.js", compiler, stats)).toMatchSnapshot(
557558
"result"
558559
);

0 commit comments

Comments
 (0)