@@ -28,47 +28,47 @@ describe('constants', () => {
2828 } )
2929
3030 it ( 'should import and re-export a simple constant' , ( ) => {
31- test ( '@value red from "./colors.css";' , ':export {\n red: i__const_red_0 \n}\n:import("./colors.css") {\n i__const_red_0: red \n}' )
31+ test ( '@value red from "./colors.css";' , ':import("./colors.css") {\n i__const_red_0: red \n}\n:export {\n red: i__const_red_0 \n}' )
3232 } )
3333
3434 it ( 'should import a simple constant and replace usages' , ( ) => {
35- test ( '@value red from "./colors.css"; .foo { color: red; }' , ':export {\n red: i__const_red_1 ;\n}\n:import("./colors.css") {\n i__const_red_1: red ;\n}\n.foo { color: i__const_red_1; }' )
35+ test ( '@value red from "./colors.css"; .foo { color: red; }' , ':import("./colors.css") {\n i__const_red_1: red ;\n}\n:export {\n red: i__const_red_1 ;\n}\n.foo { color: i__const_red_1; }' )
3636 } )
3737
3838 it ( 'should import and alias a constant and replace usages' , ( ) => {
39- test ( '@value blue as red from "./colors.css"; .foo { color: red; }' , ':export {\n red: i__const_red_2 ;\n}\n:import("./colors.css") {\n i__const_red_2: blue ;\n}\n.foo { color: i__const_red_2; }' )
39+ test ( '@value blue as red from "./colors.css"; .foo { color: red; }' , ':import("./colors.css") {\n i__const_red_2: blue ;\n}\n:export {\n red: i__const_red_2 ;\n}\n.foo { color: i__const_red_2; }' )
4040 } )
4141
4242 it ( 'should import multiple from a single file' , ( ) => {
4343 test (
4444 `@value blue, red from "./colors.css";
4545.foo { color: red; }
4646.bar { color: blue }` ,
47- `:export {
48- blue: i__const_blue_3;
49- red: i__const_red_4;
50- }
51- :import("./colors.css") {
47+ `:import("./colors.css") {
5248 i__const_blue_3: blue;
5349 i__const_red_4: red;
5450}
51+ :export {
52+ blue: i__const_blue_3;
53+ red: i__const_red_4;
54+ }
5555.foo { color: i__const_red_4; }
5656.bar { color: i__const_blue_3 }` )
5757 } )
5858
5959 it ( 'should import from a definition' , ( ) => {
6060 test (
6161 '@value colors: "./colors.css"; @value red from colors;' ,
62- ':export {\n colors: "./colors.css"; \n red: i__const_red_5 \n}\n' +
63- ':import( "./colors.css") { \n i__const_red_5: red \n}'
62+ ':import( "./colors.css") { \n i__const_red_5: red \n}\n' +
63+ ':export {\n colors: "./colors.css"; \n red: i__const_red_5 \n}'
6464 )
6565 } )
6666
6767 it ( 'should only allow values for paths if defined in the right order' , ( ) => {
6868 test (
6969 '@value red from colors; @value colors: "./colors.css";' ,
70- ':export {\n red: i__const_red_6;\n colors: "./colors.css" \n}\n' +
71- ':import(colors) {\n i__const_red_6: red \n}'
70+ ':import(colors) {\n i__const_red_6: red \n}\n' +
71+ ':export {\n red: i__const_red_6;\n colors: "./colors.css" \n}'
7272 )
7373 } )
7474
@@ -85,5 +85,9 @@ describe('constants', () => {
8585 ':export {\n base: 10px;\n large: calc(10px * 2);\n}\n.a { margin: calc(10px * 2); }'
8686 )
8787 } )
88+
89+ it ( 'should preserve import order' , ( ) => {
90+ test ( '@value a from "./a.css"; @value b from "./b.css";' , ':import("./a.css") {\n i__const_a_7: a\n}\n:import("./b.css") {\n i__const_b_8: b\n}\n:export {\n a: i__const_a_7;\n b: i__const_b_8\n}' )
91+ } )
8892} )
8993
0 commit comments