Skip to content

Commit

Permalink
provide addtional testcases due to GH-1
Browse files Browse the repository at this point in the history
  • Loading branch information
just-boris committed Feb 24, 2015
1 parent 60db3b7 commit 2f590ce
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 6 deletions.
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,3 @@ Add this plugin and you can write import like this
1. `npm install -g less less-plugin-glob`
1. Create file with import by glob, something like `@import "includes/**"`
1. Run `lessc --glob styles.less styles.css` and enjoy whole your styles concated by one line


## Caveats

Now glob imports are supported only on top-level stylesheets. In deep cases current dirrectory is lost and we can't
properly resolve file paths.
1 change: 1 addition & 0 deletions test/fixtures/recursive.less
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import "three/*";
5 changes: 5 additions & 0 deletions test/fixtures/three/sub/three-sub.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* file:three-sub.less */
.three-sub {
top: 1px;
}

4 changes: 4 additions & 0 deletions test/fixtures/three/sub/three-sub2.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* file:three-sub2.less */
.three-sub {
color: red;
}
5 changes: 5 additions & 0 deletions test/fixtures/three/three.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* file:three.less */
@import "sub/**";
.three {
top: 0;
}
12 changes: 12 additions & 0 deletions test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,16 @@ describe('less-glob', function() {
})
.then(done, done);
});

it('should recursively resolve globs', function(done) {
less.render(readResource('test/fixtures/recursive.less'), options)
.then(function(output) {
assertFilesToBeIncluded(output.css, [
'three.less',
'three-sub.less',
'three-sub2.less'
]);
})
.then(done, done);
});
});

0 comments on commit 2f590ce

Please sign in to comment.