Skip to content

Commit 147f5e3

Browse files
committed
Improve resolve modules test
1 parent fdbc288 commit 147f5e3

8 files changed

+24
-14
lines changed

test/fixtures/imports/local-module/main.css

-1
This file was deleted.

test/fixtures/imports/local-module/package.json

-1
This file was deleted.

test/fixtures/modules.css renamed to test/fixtures/resolve-modules.css

-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,3 @@
1313
@import "web-use-dep";
1414
@import "web-use-dep-too";
1515
@import "web-use-dep" screen;
16-
17-
@import "local-module";
18-
19-
content{}

test/fixtures/modules.expected.css renamed to test/fixtures/resolve-modules.expected.css

-2
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,3 @@
1414
@media screen{
1515
.web-dep{}
1616
}
17-
.local-module{}
18-
content{}
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@import "simple";
2+
@import "empty";
3+
@import "style";
4+
@import "main";
5+
@import "main-js";
6+
@import "main-style";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
simple {}
2+
empty {}
3+
style {}
4+
main {}
5+
main-js {}
6+
main-styled {}

test/import.js

-6
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@ test("should ignore & adjust external import", t => {
2727
return compareFixtures(t, "ignore")
2828
})
2929

30-
test("should be able to consume npm package or local modules", t => {
31-
return compareFixtures(t, "modules", {
32-
root: ".",
33-
})
34-
})
35-
3630
test("should not fail with only one absolute import", t => {
3731
var base = "@import url(http://)"
3832
return postcss()

test/resolve.js

+12
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,15 @@ test("should resolve local modules", t => {
4040
path: null,
4141
})
4242
})
43+
44+
test("should resolve local modules", t => {
45+
return compareFixtures(t, "resolve-path-modules", {
46+
path: "fixtures/imports/modules",
47+
})
48+
})
49+
50+
test("should be able to consume npm package or local modules", t => {
51+
return compareFixtures(t, "resolve-modules", {
52+
path: null,
53+
})
54+
})

0 commit comments

Comments
 (0)