sass-graph
Advanced tools
Comparing version 1.0.3 to 1.1.0
# Change Log | ||
All notable changes to this project will be documented in this file. | ||
## [1.0.4] - 2015-03-03 | ||
### Tests | ||
- Added a test for nested imports | ||
## [1.0.3] - 2015-02-02 | ||
@@ -5,0 +9,0 @@ ### Fixed |
{ | ||
"name": "sass-graph", | ||
"version": "1.0.3", | ||
"version": "1.1.0", | ||
"description": "Parse sass files and extract a graph of imports", | ||
@@ -13,3 +13,3 @@ "license": "MIT", | ||
"scripts": { | ||
"test": "mocha ./test/test.js" | ||
"test": "mocha ./test/test*.js" | ||
}, | ||
@@ -16,0 +16,0 @@ "keywords": [ |
@@ -54,2 +54,11 @@ # Sass Graph | ||
## Running Mocha tests | ||
You can run the tests by executing the following commands: | ||
``` | ||
npm install | ||
npm test | ||
``` | ||
## Authors | ||
@@ -56,0 +65,0 @@ |
@@ -11,4 +11,4 @@ 'use strict'; | ||
function resolveSassPath(sassPath, loadPaths) { | ||
// trim any file extensions | ||
var sassPathName = sassPath.replace(/\.\w+$/, ''); | ||
// trim sass file extensions | ||
var sassPathName = sassPath.replace(/\.(css|s[ca]ss)$/, ''); | ||
// check all load paths | ||
@@ -15,0 +15,0 @@ var i, length = loadPaths.length; |
@@ -12,3 +12,8 @@ | ||
'_e.scss': fixtures + "/components/_e.scss", | ||
'f.scss': fixtures + "/f.scss" | ||
'f.scss': fixtures + "/f.scss", | ||
'g.scss': fixtures + "/g.scss", | ||
'_h.scss': fixtures + "/nested/_h.scss", | ||
'_i.scss': fixtures + "/nested/_i.scss", | ||
'j.scss': fixtures + "/j.scss", | ||
'k.l.scss': fixtures + "/components/k.l.scss" | ||
} | ||
@@ -34,2 +39,12 @@ | ||
it('should have the correct (nested) imports for g.scss', function() { | ||
var expectedDescendents = [files['_h.scss'], files['_i.scss']]; | ||
var descendents = []; | ||
graph.visitDescendents(files['g.scss'], function (imp) { | ||
descendents.push(imp); | ||
assert.notEqual(expectedDescendents.indexOf(imp), -1); | ||
}); | ||
}); | ||
it('should traverse ancestors of _c.scss', function() { | ||
@@ -36,0 +51,0 @@ ancestors = []; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15988
23
291
71