Skip to content

Commit 8bf40c6

Browse files
committed
Test edge case for packages names that look like files
1 parent ec0ee4b commit 8bf40c6

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"devDependencies": {
1919
"foundation": "4.2.1-1",
2020
"jest": "^23.4.0",
21-
"node-sass": "^4.9.2"
21+
"node-sass": "^4.9.2",
22+
"normalize.css": "^8.0.0"
2223
}
2324
}

tests/index.test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ const foundation = sass.renderSync({
55
file: 'node_modules/foundation/scss/foundation.scss',
66
}).css.toString();
77

8+
const normalize = '@import url(node_modules/normalize.css/normalize.css);\n';
9+
810
const compile = function(data) {
911
return new Promise((yeah, nah) => {
1012
return sass.render(
@@ -48,6 +50,10 @@ describe('node-module-importer', () => {
4850
it('should resolve Sass @import for partials without underscore and extension from npm packages', () => (
4951
func('@import "foundation/scss/foundation/variables"')
5052
));
53+
it('should resolve Sass @import for npm packages that look like Sass files', () => (
54+
func('@import "normalize.css/normalize.css"')
55+
.then(result => expect(result === normalize).toBeTruthy())
56+
));
5157
});
5258
});
5359
});

0 commit comments

Comments
 (0)