Commit 8c463eca authored by Philipp Nowinski's avatar Philipp Nowinski
Browse files

[TASK] adjust tests

parent 00ec8009
......@@ -18,6 +18,8 @@ describe('sgalinski generator', function() {
sassPath: 'sass',
javascriptPath: 'js',
imagesPath: 'images',
svgPath: 'svg',
spritePath: 'sprites',
extensions: 'test_ext,test_ext_two'
})
.on('end', done);
......@@ -27,6 +29,7 @@ describe('sgalinski generator', function() {
assert.file([
'.editorconfig',
'.jshintrc',
'.scss-lint.yml',
'package.json'
]);
});
......@@ -48,6 +51,8 @@ describe('sgalinski generator', function() {
assert.fileContent('gulp/config.json', '"javascript": "js"');
assert.fileContent('gulp/config.json', '"sass": "sass"');
assert.fileContent('gulp/config.json', '"images": "images"');
assert.fileContent('gulp/config.json', '"svg": "images/svg"');
assert.fileContent('gulp/config.json', '"sprites": "images/sprites"');
assert.fileContent('gulp/config.json', '"extensions": [\n\t\t"test_ext",\n\t\t"test_ext_two"\n\t]');
});
......@@ -55,16 +60,17 @@ describe('sgalinski generator', function() {
assert.fileContent('gulp/css.js', '.pipe(autoprefixer(\'last 1 version\'))');
});
it('does not install minification', function() {
assert.noFileContent('package.json', 'gulp-minify-css');
assert.noFileContent('package.json', 'gulp-uglify');
assert.noFileContent('gulp/css.js', 'minifyCss = require(\'gulp-minify-css\')');
assert.noFileContent('gulp/javascript.js', 'uglify = require(\'gulp-uglify\')');
it('does set no JS and CSS limits', function() {
assert.noFileContent('gulp/css.js', 'filesizeLimit');
assert.noFileContent('gulp/css.js', 'filesizeLimitGzipped');
assert.noFileContent('gulp/javascript.js', 'filesizeLimit');
assert.noFileContent('gulp/javascript.js', 'filesizeLimitGzipped');
});
});
describe('sgalinski generator with minification', function() {
describe('sgalinski generator with filesizelimits', function() {
before(function(done) {
helpers.run(path.join(__dirname, '../app'))
.inDir(path.join(os.tmpdir(), './temp-test'))
......@@ -76,18 +82,22 @@ describe('sgalinski generator with minification', function() {
sassPath: 'sass',
javascriptPath: 'js',
imagesPath: 'images',
extensions: 'test_ext,test_ext_two',
minifyCss: true,
jsuglify: true
svgPath: 'svg',
spritePath: 'sprites',
filesizeLimitCss: 2500,
filesizeLimitGzippedCss: 1500,
filesizeLimitJs: 2500,
filesizeLimitGzippedJs: 1500
})
.on('end', done);
});
it('does not install minification', function() {
assert.fileContent('package.json', 'gulp-minify-css');
assert.fileContent('package.json', 'gulp-uglify');
assert.fileContent('gulp/css.js', 'minifyCss = require(\'gulp-minify-css\')');
assert.fileContent('gulp/javascript.js', 'uglify = require(\'gulp-uglify\')');
it('does set correct JS and CSS limits', function() {
assert.fileContent('gulp/css.js', 'filesizeLimit: 2500');
assert.fileContent('gulp/css.js', 'filesizeLimitGzipped: 1500');
assert.fileContent('gulp/javascript.js', 'filesizeLimit: 2500');
assert.fileContent('gulp/javascript.js', 'filesizeLimitGzipped: 1500');
});
});
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment