Init
This commit is contained in:
commit
4e066bffc9
10017 changed files with 1322084 additions and 0 deletions
36
node_modules/gulp-concat-css/test/expected/build/bundle-all.css
generated
vendored
Normal file
36
node_modules/gulp-concat-css/test/expected/build/bundle-all.css
generated
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
@import url(http://fonts.googleapis.com/css);
|
||||
@import url("//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700,400italic");
|
||||
@font-face {
|
||||
font-family: 'Font';
|
||||
src: url("../lib/fonts/webfont.eot");
|
||||
}
|
||||
|
||||
.navbar-header-2 {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.navbar-header:after {
|
||||
clear: both;
|
||||
background: url("data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/") no-repeat left center;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.navbar-header {
|
||||
background: url("data:image/png;base64,iVBORwJggg==") no-repeat scroll 100% 50% rgba(0, 0, 0, 0);
|
||||
float: left;
|
||||
}
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Font';
|
||||
src: url("../lib/fonts/webfont.eot?v=4.0.0");
|
||||
src: url("../lib/fonts/webfont.eot");
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Font1';
|
||||
src: url("../lib/fonts/webfont.eot");
|
||||
}
|
||||
|
||||
.navbar-header {
|
||||
clear: both;
|
||||
}
|
||||
15
node_modules/gulp-concat-css/test/expected/build/bundle-bubbleonly.css
generated
vendored
Normal file
15
node_modules/gulp-concat-css/test/expected/build/bundle-bubbleonly.css
generated
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
@import url('subdir/imported.css');
|
||||
@import url("//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700,400italic");
|
||||
@font-face {
|
||||
font-family: 'Font';
|
||||
src: url('lib/fonts/webfont.eot?v=4.0.0');
|
||||
src: url('lib/fonts/webfont.eot');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Font1';
|
||||
src: url('../lib/fonts/webfont.eot');
|
||||
}
|
||||
|
||||
.navbar-header {
|
||||
clear: both;
|
||||
}
|
||||
36
node_modules/gulp-concat-css/test/expected/build/bundle-import.css
generated
vendored
Normal file
36
node_modules/gulp-concat-css/test/expected/build/bundle-import.css
generated
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
@import url(http://fonts.googleapis.com/css);
|
||||
@import url("//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700,400italic");
|
||||
@font-face {
|
||||
font-family: 'Font';
|
||||
src: url('../lib/fonts/webfont.eot');
|
||||
}
|
||||
|
||||
.navbar-header-2 {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.navbar-header:after {
|
||||
clear: both;
|
||||
background: url(data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/) no-repeat left center;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.navbar-header {
|
||||
background: url('data:image/png;base64,iVBORwJggg==') no-repeat scroll 100% 50% rgba(0, 0, 0, 0);
|
||||
float: left;
|
||||
}
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Font';
|
||||
src: url('lib/fonts/webfont.eot?v=4.0.0');
|
||||
src: url('lib/fonts/webfont.eot');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Font1';
|
||||
src: url('../lib/fonts/webfont.eot');
|
||||
}
|
||||
|
||||
.navbar-header {
|
||||
clear: both;
|
||||
}
|
||||
15
node_modules/gulp-concat-css/test/expected/build/bundle-rebase.css
generated
vendored
Normal file
15
node_modules/gulp-concat-css/test/expected/build/bundle-rebase.css
generated
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
@import url('subdir/imported.css');
|
||||
@import url("//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700,400italic");
|
||||
@font-face {
|
||||
font-family: 'Font';
|
||||
src: url("../lib/fonts/webfont.eot?v=4.0.0");
|
||||
src: url("../lib/fonts/webfont.eot");
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Font1';
|
||||
src: url("../lib/fonts/webfont.eot");
|
||||
}
|
||||
|
||||
.navbar-header {
|
||||
clear: both;
|
||||
}
|
||||
7
node_modules/gulp-concat-css/test/fixtures/main.css
generated
vendored
Normal file
7
node_modules/gulp-concat-css/test/fixtures/main.css
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
@import url('subdir/imported.css');
|
||||
|
||||
@font-face {
|
||||
font-family: 'Font';
|
||||
src: url('lib/fonts/webfont.eot?v=4.0.0');
|
||||
src: url('lib/fonts/webfont.eot');
|
||||
}
|
||||
17
node_modules/gulp-concat-css/test/fixtures/subdir/imported.css
generated
vendored
Normal file
17
node_modules/gulp-concat-css/test/fixtures/subdir/imported.css
generated
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
@font-face {
|
||||
font-family: 'Font';
|
||||
src: url('../lib/fonts/webfont.eot');
|
||||
}
|
||||
|
||||
@import url("../vendor/importedRecursive.css");
|
||||
|
||||
.navbar-header:after {
|
||||
clear: both;
|
||||
background: url(data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/) no-repeat left center;
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.navbar-header {
|
||||
background: url('data:image/png;base64,iVBORwJggg==') no-repeat scroll 100% 50% rgba(0, 0, 0, 0);
|
||||
float: left;
|
||||
}
|
||||
}
|
||||
5
node_modules/gulp-concat-css/test/fixtures/vendor/importedRecursive.css
generated
vendored
Normal file
5
node_modules/gulp-concat-css/test/fixtures/vendor/importedRecursive.css
generated
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
@import url(http://fonts.googleapis.com/css);
|
||||
|
||||
.navbar-header-2 {
|
||||
clear: both;
|
||||
}
|
||||
11
node_modules/gulp-concat-css/test/fixtures/vendor/vendor.css
generated
vendored
Normal file
11
node_modules/gulp-concat-css/test/fixtures/vendor/vendor.css
generated
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
@import url("//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700,400italic");
|
||||
|
||||
@font-face {
|
||||
font-family: 'Font1';
|
||||
src: url('../lib/fonts/webfont.eot');
|
||||
}
|
||||
|
||||
|
||||
.navbar-header {
|
||||
clear: both;
|
||||
}
|
||||
130
node_modules/gulp-concat-css/test/test.js
generated
vendored
Normal file
130
node_modules/gulp-concat-css/test/test.js
generated
vendored
Normal file
|
|
@ -0,0 +1,130 @@
|
|||
var expect = require('chai').expect,
|
||||
through = require('through2'),
|
||||
gutil = require('gulp-util'),
|
||||
fs = require('fs'),
|
||||
path = require('path'),
|
||||
concatCss = require('../');
|
||||
|
||||
|
||||
function expected(file) {
|
||||
var base = path.join(process.cwd(), 'test/expected');
|
||||
var filepath = path.resolve(base, file);
|
||||
return new gutil.File({
|
||||
path: filepath,
|
||||
cwd: process.cwd(),
|
||||
base: base,
|
||||
contents: fs.readFileSync(filepath)
|
||||
});
|
||||
}
|
||||
|
||||
function fixture(file) {
|
||||
var base = path.join(process.cwd(), 'test/fixtures');
|
||||
var filepath = path.join(base, file);
|
||||
return new gutil.File({
|
||||
path: filepath,
|
||||
cwd: process.cwd(),
|
||||
base: base,
|
||||
contents: fs.readFileSync(filepath)
|
||||
});
|
||||
}
|
||||
|
||||
describe('gulp-concat-css', function() {
|
||||
it('should only bubble up imports', function(done) {
|
||||
var now = Date.now();
|
||||
var stream = concatCss('build/bundle-bubbleonly.css', {inlineImports: false, rebaseUrls: false});
|
||||
var expectedFile = expected('build/bundle-bubbleonly.css');
|
||||
stream
|
||||
.pipe(through.obj(function(file, enc, cb) {
|
||||
//fs.writeFileSync("bundle.css", file.contents);
|
||||
|
||||
expect(String(file.contents)).to.be.equal(String(expectedFile.contents));
|
||||
expect(path.basename(file.path)).to.be.equal(path.basename(expectedFile.path));
|
||||
expect(file.cwd, "cwd").to.be.equal(expectedFile.cwd);
|
||||
expect(file.relative, "relative").to.be.equal(expectedFile.relative);
|
||||
console.log('Execution time: ' + (Date.now() - now) + 'ms');
|
||||
done();
|
||||
}));
|
||||
|
||||
stream.write(fixture('main.css'));
|
||||
stream.write(fixture('vendor/vendor.css'));
|
||||
stream.end();
|
||||
});
|
||||
|
||||
it('should only rebase urls', function(done) {
|
||||
var now = Date.now();
|
||||
var stream = concatCss('build/bundle-rebase.css', {inlineImports: false});
|
||||
var expectedFile = expected('build/bundle-rebase.css');
|
||||
stream
|
||||
.pipe(through.obj(function(file, enc, cb) {
|
||||
//fs.writeFileSync("bundle.css", file.contents);
|
||||
|
||||
expect(String(file.contents)).to.be.equal(String(expectedFile.contents));
|
||||
expect(path.basename(file.path)).to.be.equal(path.basename(expectedFile.path));
|
||||
expect(file.cwd, "cwd").to.be.equal(expectedFile.cwd);
|
||||
expect(file.relative, "relative").to.be.equal(expectedFile.relative);
|
||||
console.log('Execution time: ' + (Date.now() - now) + 'ms');
|
||||
done();
|
||||
}));
|
||||
|
||||
stream.write(fixture('main.css'));
|
||||
stream.write(fixture('vendor/vendor.css'));
|
||||
stream.end();
|
||||
});
|
||||
|
||||
|
||||
it('should only inline imports', function(done) {
|
||||
var now = Date.now();
|
||||
var stream = concatCss('build/bundle-import.css', {inlineImports: true, rebaseUrls: false});
|
||||
var expectedFile = expected('build/bundle-import.css');
|
||||
stream
|
||||
.pipe(through.obj(function(file, enc, cb) {
|
||||
//fs.writeFileSync("bundle.css", file.contents);
|
||||
|
||||
expect(String(file.contents)).to.be.equal(String(expectedFile.contents));
|
||||
expect(path.basename(file.path)).to.be.equal(path.basename(expectedFile.path));
|
||||
expect(file.cwd, "cwd").to.be.equal(expectedFile.cwd);
|
||||
expect(file.relative, "relative").to.be.equal(expectedFile.relative);
|
||||
console.log('Execution time: ' + (Date.now() - now) + 'ms');
|
||||
done();
|
||||
}));
|
||||
|
||||
stream.write(fixture('main.css'));
|
||||
stream.write(fixture('vendor/vendor.css'));
|
||||
stream.end();
|
||||
});
|
||||
|
||||
it('should concat, rebase urls, inline imports and bubble up external imports', function(done) {
|
||||
var now = Date.now();
|
||||
var stream = concatCss('build/bundle-all.css');
|
||||
var expectedFile = expected('build/bundle-all.css');
|
||||
stream
|
||||
.pipe(through.obj(function(file, enc, cb) {
|
||||
//fs.writeFileSync("bundle.css", file.contents);
|
||||
expect(String(file.contents)).to.be.equal(String(expectedFile.contents));
|
||||
expect(path.basename(file.path)).to.be.equal(path.basename(expectedFile.path));
|
||||
expect(file.cwd, "cwd").to.be.equal(expectedFile.cwd);
|
||||
expect(file.relative, "relative").to.be.equal(expectedFile.relative);
|
||||
console.log('Execution time: ' + (Date.now() - now) + 'ms');
|
||||
done();
|
||||
}));
|
||||
|
||||
stream.write(fixture('main.css'));
|
||||
stream.write(fixture('vendor/vendor.css'));
|
||||
stream.end();
|
||||
});
|
||||
|
||||
it('should not crash if no file is provided', function(done) {
|
||||
var stream = concatCss('build/bundle-all.css');
|
||||
stream
|
||||
.on('error', function() {
|
||||
done(false);
|
||||
})
|
||||
.pipe(through.obj(function(file, enc, cb) {
|
||||
done(false);
|
||||
}, function() {
|
||||
done();
|
||||
}));
|
||||
|
||||
stream.end();
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue