mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
Unit tests require config file to be present.
Conflicts: Gruntfile.js core/test/unit/admin_spec.js
This commit is contained in:
parent
4210c03ec8
commit
63d8cbb87c
2 changed files with 12 additions and 5 deletions
14
Gruntfile.js
14
Gruntfile.js
|
@ -3,10 +3,12 @@ var path = require('path'),
|
||||||
semver = require("semver"),
|
semver = require("semver"),
|
||||||
fs = require("fs"),
|
fs = require("fs"),
|
||||||
path = require("path"),
|
path = require("path"),
|
||||||
|
_ = require('underscore'),
|
||||||
spawn = require("child_process").spawn,
|
spawn = require("child_process").spawn,
|
||||||
buildDirectory = path.resolve(process.cwd(), '.build'),
|
buildDirectory = path.resolve(process.cwd(), '.build'),
|
||||||
distDirectory = path.resolve(process.cwd(), '.dist'),
|
distDirectory = path.resolve(process.cwd(), '.dist'),
|
||||||
_ = require('underscore'),
|
configLoader = require('./core/config-loader.js'),
|
||||||
|
|
||||||
configureGrunt = function (grunt) {
|
configureGrunt = function (grunt) {
|
||||||
|
|
||||||
// load all grunt tasks
|
// load all grunt tasks
|
||||||
|
@ -351,6 +353,13 @@ var path = require('path'),
|
||||||
process.env.NODE_ENV = process.env.TRAVIS ? 'travis' : 'testing';
|
process.env.NODE_ENV = process.env.TRAVIS ? 'travis' : 'testing';
|
||||||
});
|
});
|
||||||
|
|
||||||
|
grunt.registerTask('loadConfig', function () {
|
||||||
|
var done = this.async();
|
||||||
|
configLoader.loadConfig().then(function () {
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// Update the package information after changes
|
// Update the package information after changes
|
||||||
grunt.registerTask('updateCurrentPackageInfo', function () {
|
grunt.registerTask('updateCurrentPackageInfo', function () {
|
||||||
cfg.pkg = grunt.file.readJSON('package.json');
|
cfg.pkg = grunt.file.readJSON('package.json');
|
||||||
|
@ -681,13 +690,12 @@ var path = require('path'),
|
||||||
"watch"
|
"watch"
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
// Prepare the project for development
|
// Prepare the project for development
|
||||||
// TODO: Git submodule init/update (https://github.com/jaubourg/grunt-update-submodules)?
|
// TODO: Git submodule init/update (https://github.com/jaubourg/grunt-update-submodules)?
|
||||||
grunt.registerTask("init", ["shell:bourbon", "sass:admin", 'handlebars']);
|
grunt.registerTask("init", ["shell:bourbon", "sass:admin", 'handlebars']);
|
||||||
|
|
||||||
// Run unit tests
|
// Run unit tests
|
||||||
grunt.registerTask("test-unit", ['setTestEnv', "mochacli:all"]);
|
grunt.registerTask("test-unit", ['setTestEnv', 'loadConfig', "mochacli:all"]);
|
||||||
|
|
||||||
// Run casperjs tests only
|
// Run casperjs tests only
|
||||||
grunt.registerTask('test-functional', ['setTestEnv', 'express:test', 'spawn-casperjs']);
|
grunt.registerTask('test-functional', ['setTestEnv', 'express:test', 'spawn-casperjs']);
|
||||||
|
|
|
@ -38,7 +38,6 @@ describe('Admin Controller', function() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
describe('valid file', function() {
|
describe('valid file', function() {
|
||||||
|
|
||||||
var clock;
|
var clock;
|
||||||
|
|
Loading…
Add table
Reference in a new issue