Skip to content

Commit f4393d0

Browse files
committed
less integration test proves that it compiles in a reasonable amount of time with sourcemaps
1 parent b04a217 commit f4393d0

File tree

4 files changed

+36
-1
lines changed

4 files changed

+36
-1
lines changed

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"cover": "istanbul cover --dir reports/coverage tape \"test/*.js\"",
1212
"coveralls": "istanbul cover tape \"test/*.js\" --report lcovonly && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage",
1313
"serve": "http-server",
14-
"test:int":"rm -rf ./tmp && tape ./test/integration.js"
14+
"test:int": "rm -rf ./tmp && tape ./test/integration.js"
1515
},
1616
"keywords": [
1717
"gulpplugin",
@@ -34,11 +34,13 @@
3434
"vinyl": "1.X"
3535
},
3636
"devDependencies": {
37+
"bootstrap": "3.3.7",
3738
"coveralls": "2.X",
3839
"faucet": "0.0.X",
3940
"gulp": "3.X",
4041
"gulp-concat": "2.X",
4142
"gulp-if": "2.0.2",
43+
"gulp-less": "3.3.0",
4244
"gulp-load-plugins": "1.X",
4345
"hook-std": "0.2.X",
4446
"http-server": "0.9.0",

test/assets/index.html

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
helloWorld();
88
helloWorld2();
99
</script>
10+
<link rel="stylesheet" type="text/css" href="./test.css">
1011
</head>
1112
<body>
1213
</body>

test/assets/test.less

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
@import "../../node_modules/bootstrap/less/bootstrap.less";
2+
3+
body {
4+
background: #eee;
5+
color: #888;
6+
7+
.some-class {
8+
font-size: 12px;
9+
}
10+
11+
div {
12+
background: black;
13+
}
14+
}

test/integration.js

+18
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,24 @@ test('combined: inline concatenated file', function(t) {
127127
});
128128
});
129129

130+
test('combined: less: inline concatenated file', {timeout: 1500}, function(t) {
131+
// proves that gulp-less compilation is not slow
132+
// https://github.com/floridoo/gulp-sourcemaps/issues/215
133+
134+
gulp.src(join(__dirname, './assets/*.less'))
135+
.pipe(sourcemaps.init())
136+
.pipe($.if("*.less",$.less()))
137+
.pipe(sourcemaps.write({sourceRoot:'../../test/assets'}))
138+
.pipe(gulp.dest('tmp/combined_inline_less'))
139+
.on('error', function() {
140+
t.fail('emitted error');
141+
t.end();
142+
})
143+
.on('finish', function(){
144+
moveHtml('combined_inline_less', t);
145+
});
146+
});
147+
130148
test('combined: mapped preExisting', function(t) {
131149

132150
gulp.src([

0 commit comments

Comments
 (0)