mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
improvement: travis server (#7032)
no issue - do not build client when running server tests
This commit is contained in:
parent
e046ac3f5a
commit
3f3ed61273
1 changed files with 19 additions and 3 deletions
22
Gruntfile.js
22
Gruntfile.js
|
@ -41,6 +41,14 @@ var _ = require('lodash'),
|
||||||
// Load package.json so that we can create correctly versioned releases.
|
// Load package.json so that we can create correctly versioned releases.
|
||||||
pkg: grunt.file.readJSON('package.json'),
|
pkg: grunt.file.readJSON('package.json'),
|
||||||
|
|
||||||
|
clientFiles: [
|
||||||
|
'server/views/default.hbs',
|
||||||
|
'built/assets/ghost.js',
|
||||||
|
'built/assets/ghost.css',
|
||||||
|
'built/assets/vendor.js',
|
||||||
|
'built/assets/vendor.css'
|
||||||
|
],
|
||||||
|
|
||||||
// ### grunt-contrib-watch
|
// ### grunt-contrib-watch
|
||||||
// Watch files and livereload in the browser during development.
|
// Watch files and livereload in the browser during development.
|
||||||
// See the [grunt dev](#live%20reload) task for how this is used.
|
// See the [grunt dev](#live%20reload) task for how this is used.
|
||||||
|
@ -485,6 +493,16 @@ var _ = require('lodash'),
|
||||||
grunt.task.run('test-setup', 'mochacli:single');
|
grunt.task.run('test-setup', 'mochacli:single');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// #### Stub out ghost files *(Utility Task)*
|
||||||
|
// Creates stub files in the built directory and the views directory
|
||||||
|
// so that the test environments do not need to build out the client files
|
||||||
|
grunt.registerTask('stubClientFiles', function () {
|
||||||
|
_.each(cfg.clientFiles, function (file) {
|
||||||
|
var filePath = path.resolve(cwd + '/core/' + file);
|
||||||
|
fs.ensureFileSync(filePath);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// ### Validate
|
// ### Validate
|
||||||
// **Main testing task**
|
// **Main testing task**
|
||||||
//
|
//
|
||||||
|
@ -496,9 +514,7 @@ var _ = require('lodash'),
|
||||||
// `grunt validate` is called by `npm test` and is used by Travis.
|
// `grunt validate` is called by `npm test` and is used by Travis.
|
||||||
grunt.registerTask('validate', 'Run tests and lint code', function () {
|
grunt.registerTask('validate', 'Run tests and lint code', function () {
|
||||||
if (process.env.TEST_SUITE === 'server') {
|
if (process.env.TEST_SUITE === 'server') {
|
||||||
grunt.task.run(['init', 'test-server']);
|
grunt.task.run(['stubClientFiles', 'test-server']);
|
||||||
} else if (process.env.TEST_SUITE === 'client') {
|
|
||||||
grunt.task.run(['init', 'test-client']);
|
|
||||||
} else if (process.env.TEST_SUITE === 'lint') {
|
} else if (process.env.TEST_SUITE === 'lint') {
|
||||||
grunt.task.run(['lint']);
|
grunt.task.run(['lint']);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue