Skip to content

Commit

Permalink
less integration test proves that it compiles in a reasonable amount …
Browse files Browse the repository at this point in the history
…of time with sourcemaps
  • Loading branch information
nmccready committed Jan 8, 2017
1 parent b04a217 commit f4393d0
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 1 deletion.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"cover": "istanbul cover --dir reports/coverage tape \"test/*.js\"",
"coveralls": "istanbul cover tape \"test/*.js\" --report lcovonly && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage",
"serve": "http-server",
"test:int":"rm -rf ./tmp && tape ./test/integration.js"
"test:int": "rm -rf ./tmp && tape ./test/integration.js"
},
"keywords": [
"gulpplugin",
Expand All @@ -34,11 +34,13 @@
"vinyl": "1.X"
},
"devDependencies": {
"bootstrap": "3.3.7",
"coveralls": "2.X",
"faucet": "0.0.X",
"gulp": "3.X",
"gulp-concat": "2.X",
"gulp-if": "2.0.2",
"gulp-less": "3.3.0",
"gulp-load-plugins": "1.X",
"hook-std": "0.2.X",
"http-server": "0.9.0",
Expand Down
1 change: 1 addition & 0 deletions test/assets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
helloWorld();
helloWorld2();
</script>
<link rel="stylesheet" type="text/css" href="./test.css">
</head>
<body>
</body>
Expand Down
14 changes: 14 additions & 0 deletions test/assets/test.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@import "../../node_modules/bootstrap/less/bootstrap.less";

body {
background: #eee;
color: #888;

.some-class {
font-size: 12px;
}

div {
background: black;
}
}
18 changes: 18 additions & 0 deletions test/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,24 @@ test('combined: inline concatenated file', function(t) {
});
});

test('combined: less: inline concatenated file', {timeout: 1500}, function(t) {
// proves that gulp-less compilation is not slow
// https://github.com/floridoo/gulp-sourcemaps/issues/215

gulp.src(join(__dirname, './assets/*.less'))
.pipe(sourcemaps.init())
.pipe($.if("*.less",$.less()))
.pipe(sourcemaps.write({sourceRoot:'../../test/assets'}))
.pipe(gulp.dest('tmp/combined_inline_less'))
.on('error', function() {
t.fail('emitted error');
t.end();
})
.on('finish', function(){
moveHtml('combined_inline_less', t);
});
});

test('combined: mapped preExisting', function(t) {

gulp.src([
Expand Down

0 comments on commit f4393d0

Please sign in to comment.