File tree Expand file tree Collapse file tree 10 files changed +22
-22
lines changed
import-multiple-references Expand file tree Collapse file tree 10 files changed +22
-22
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ var processor = require("../");
10
10
describe ( "custom-import-name" , function ( ) {
11
11
it ( "should allow to provide a custom imported name" , function ( ) {
12
12
var input = ":local(.name) { extends: abc from \"def\"; }" ;
13
- var expected = ":import(\"def\") {\n abc: abc -from-def;\n}\n:local(.name) { extends: abc-from-def; }" ;
13
+ var expected = ":import(\"def\") {\n abc-from-def: abc ;\n}\n:local(.name) { extends: abc-from-def; }" ;
14
14
var pipeline = postcss ( [ processor ( {
15
15
createImportedName : function ( importName , path ) { return importName + "-from-" + path ; }
16
16
} ) ] ) ;
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ var processor = require("../");
11
11
var pipeline = postcss ( [ processor ] ) ;
12
12
13
13
function normalize ( str ) {
14
- return str . replace ( / \r \n ? / g, "\n" ) ;
14
+ return str . replace ( / \r \n ? / g, "\n" ) . replace ( / \n $ / , '' ) ;
15
15
}
16
16
17
17
describe ( "test-cases" , function ( ) {
Original file line number Diff line number Diff line change 1
1
: import ("path/library.css" ) {
2
- importName : __imported_importName_0 ;
3
- secondImport : __imported_secondImport_1 ;
4
- thirdImport : __imported_thirdImport_2 ;
2
+ __imported_importName_0 : importName ;
3
+ __imported_secondImport_1 : secondImport ;
4
+ __imported_thirdImport_2 : thirdImport ;
5
5
}
6
6
: import ("path/other-lib.css" ) {
7
- otherLibImport : __imported_otherLibImport_3 ;
7
+ __imported_otherLibImport_3 : otherLibImport ;
8
8
}
9
9
: local (.exportName ) {
10
10
extends : __imported_importName_0 __imported_secondImport_1;
Original file line number Diff line number Diff line change 1
1
: import ("path/library.css" ) {
2
- importName : __imported_importName_0 ;
3
- importName2 : __imported_importName2_1 ;
2
+ __imported_importName_0 : importName ;
3
+ __imported_importName2_1 : importName2 ;
4
4
}
5
5
6
6
@media screen {
Original file line number Diff line number Diff line change 1
1
: import ("path/library.css" ) {
2
- importName : __imported_importName_0 ;
3
- secondImport : __imported_secondImport_1 ;
2
+ __imported_importName_0 : importName ;
3
+ __imported_secondImport_1 : secondImport ;
4
4
}
5
- : local (.exportName ) { extends : __imported_importName_0 __imported_secondImport_1; other : rule; }
5
+ : local (.exportName ) { extends : __imported_importName_0 __imported_secondImport_1; other : rule; }
Original file line number Diff line number Diff line change 1
1
: import ("path/library.css" ) {
2
- importName : __imported_importName_0 ;
3
- secondImport : __imported_secondImport_1 ;
4
- importName2 : __imported_importName2_3 ;
2
+ __imported_importName_0 : importName ;
3
+ __imported_secondImport_1 : secondImport ;
4
+ __imported_importName2_3 : importName2 ;
5
5
}
6
6
: import ("path/library2.css" ) {
7
- importName : __imported_importName_2 ;
7
+ __imported_importName_2 : importName ;
8
8
}
9
9
: import ("path/dep3.css" ) {
10
- thirdDep : __imported_thirdDep_4 ;
10
+ __imported_thirdDep_4 : thirdDep ;
11
11
}
12
12
: local (.exportName ) {
13
13
extends : __imported_importName_0 __imported_secondImport_1;
Original file line number Diff line number Diff line change 1
1
: import ("./b.css" ) {
2
- b : __imported_b_0 ;
2
+ __imported_b_0 : b ;
3
3
}
4
4
: import ("./c.css" ) {
5
- c : __imported_c_1 ;
5
+ __imported_c_1 : c ;
6
6
}
7
7
.a {
8
8
extends : __imported_b_0;
Original file line number Diff line number Diff line change 1
1
: import ("path/library.css" ) {
2
- importName : __imported_importName_0 ;
2
+ __imported_importName_0 : importName ;
3
3
}
4
4
: local (.exportName ) {
5
5
extends : __imported_importName_0;
Original file line number Diff line number Diff line change 1
1
: import ("path/library.css" ) {
2
- importName : __imported_importName_0 ;
3
- importName2 : __imported_importName2_1 ;
2
+ __imported_importName_0 : importName ;
3
+ __imported_importName2_1 : importName2 ;
4
4
}
5
5
: local (.exportName ) {
6
6
extends : __imported_importName_0;
Original file line number Diff line number Diff line change 1
1
: import ("path/library.css" ) {
2
- importName : __imported_importName_0 ;
2
+ __imported_importName_0 : importName ;
3
3
}
4
4
: local (.exportName ) {
5
5
extends : __imported_importName_0;
You can’t perform that action at this time.
0 commit comments