NEW automatically set strong globalize to english when passing tests

This commit is contained in:
pierreclr 2017-01-25 16:53:02 +01:00
parent dfa1f6035b
commit 2583fcddce
2 changed files with 11 additions and 2 deletions

View File

@ -234,6 +234,10 @@ module.exports = function(grunt) {
// Default task.
grunt.registerTask('default', ['browserify']);
grunt.registerTask('set-test-env', function() {
process.env.NODE_ENV = 'test';
});
grunt.registerTask('test', [
'eslint',
process.env.JENKINS_HOME ? 'mochaTest:unit-xml' : 'mochaTest:unit',
@ -242,5 +246,5 @@ module.exports = function(grunt) {
]);
// alias for sl-ci-run and `npm test`
grunt.registerTask('mocha-and-karma', ['test']);
grunt.registerTask('mocha-and-karma', ['set-test-env', 'test']);
};

View File

@ -7,5 +7,10 @@
var path = require('path');
var SG = require('strong-globalize');
if (process.env.NODE_ENV === 'test') {
module.exports = SG({language: 'en'});
} else {
module.exports = SG();
}
SG.SetRootDir(path.join(__dirname, '..'), {autonomousMsgLoading: 'all'});
module.exports = SG();