Commit f326b91a authored by Philipp Nowinski's avatar Philipp Nowinski
Browse files

[FEATURE] add test cases for stanalone

parent e3746aa4
module.exports = {
path: {
css: 'css',
sass: 'sass',
javascript: 'js',
compassConfig: '.',
images: 'imgs'
}
};
/*global describe, beforeEach, it */
'use strict';
var assert = require('assert');
......
/*global describe, beforeEach, it */
'use strict';
var path = require('path'),
assert = assert = require('yeoman-generator').assert,
helpers = require('yeoman-generator').test,
os = require('os'),
fs = require('fs');
describe('sgalinski generator:standalone', function() {
before(function(done) {
helpers.run(path.join(__dirname, '../app'))
.inDir(path.join(os.tmpdir(), './temp-test'))
.withOptions({ 'skip-install': true })
.withPrompt({
projectType: 'standalone',
projectName: 'test',
cssPath: 'css',
sassPath: 'sass',
javascriptPath: 'js',
compassConfigPath: '.',
imagesPath: 'imgs',
autoprefixerBrowserSelection: '\'last 1 version\''
})
.on('end', done);
});
it('creates config files', function() {
assert.file([
'bower.json',
'config.rb',
'.editorconfig',
'.jshintrc',
'package.json'
]);
});
it('creates gulp files', function() {
assert.file([
'gulpfile.js',
'gulp/browser-sync.js',
'gulp/css.js',
'gulp/images.js',
'gulp/javascript.js',
'gulp/settings.js'
]);
});
it('creates basic asset files', function() {
assert.file([
'index.html',
'js/main.js',
'sass/main.scss'
]);
});
it('creates the autoprefixer task with the right options', function(done) {
assert.fileContent('gulp/css.js', 'autoprefixer(\'last 1 version\')');
done();
});
it('creates correct gulp settings', function(done) {
fs.readFile(path.join(__dirname, 'standalone-settings.txt'), 'utf-8', function(err, expected) {
if (err) {
throw err;
}
assert.fileContent('gulp/settings.js', expected);
done();
});
});
});
Supports Markdown
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