Skip to content

Commit 62d8492

Browse files
committed
fix(server): grunt test was incorrectly using dev config, fixes #179
1 parent 9ea9c6d commit 62d8492

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

Diff for: templates/common/Gruntfile.js

+5-8
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
// use this if you want to recursively match all subfolders:
88
// 'test/spec/**/*.js'
99

10-
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
11-
var config = require('./lib/config/config');
12-
1310
module.exports = function (grunt) {
1411

1512
// Load grunt tasks automatically
@@ -29,7 +26,7 @@ module.exports = function (grunt) {
2926
},
3027
express: {
3128
options: {
32-
port: config.port
29+
port: process.env.PORT || 9000
3330
},
3431
dev: {
3532
options: {
@@ -91,7 +88,7 @@ module.exports = function (grunt) {
9188
'{.tmp,<%%= yeoman.app %>}/scripts/{,*//*}*.js',
9289
'<%%= yeoman.app %>/images/{,*//*}*.{png,jpg,jpeg,gif,webp,svg}'
9390
],
94-
91+
9592
options: {
9693
livereload: true
9794
}
@@ -189,7 +186,7 @@ module.exports = function (grunt) {
189186
options: {
190187
nodeArgs: ['--debug-brk'],
191188
env: {
192-
PORT: config.port
189+
PORT: process.env.PORT || 9000
193190
},
194191
callback: function (nodemon) {
195192
nodemon.on('log', function (event) {
@@ -200,7 +197,7 @@ module.exports = function (grunt) {
200197
nodemon.on('config:update', function () {
201198
setTimeout(function () {
202199
require('open')('http://localhost:8080/debug?port=5858');
203-
}, 500);
200+
}, 500);
204201
});
205202
}
206203
}
@@ -561,7 +558,7 @@ module.exports = function (grunt) {
561558
'test:server',
562559
'test:client'
563560
]);
564-
});
561+
});
565562

566563
grunt.registerTask('build', [
567564
'clean:dist',

0 commit comments

Comments
 (0)