Skip to content

Commit a84f644

Browse files
committed
test(gen): fix grunt test false positives
#closes 606
1 parent 68b34f3 commit a84f644

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

Diff for: test/test-file-creation.js

+8-16
Original file line numberDiff line numberDiff line change
@@ -90,25 +90,17 @@ describe('angular-fullstack generator', function () {
9090
self.timeout(timeout || 60000);
9191

9292
var execFn = function() {
93-
exec(cmd, function(error, stdout, stderr) {
94-
switch(cmd) {
95-
case 'grunt jshint':
96-
case 'grunt jscs':
97-
expect(stdout).to.contain('Done, without errors.');
98-
break;
99-
case 'grunt test:client':
100-
case 'grunt test:e2e':
101-
expect(stdout, 'Client tests failed \n' + stdout).to.contain('Done, without errors.');
102-
break;
103-
case 'grunt test:server':
104-
expect(stdout, 'Server tests failed (do you have mongoDB running?) \n' + stdout).to.contain('Done, without errors.');
105-
break;
106-
default:
107-
expect(stderr).to.be.empty;
93+
var cmdCode;
94+
var cp = exec(cmd, function(error, stdout, stderr) {
95+
if(cmdCode !== 0) {
96+
console.error(stdout);
97+
throw new Error('Error running command: ' + cmd);
10898
}
109-
11099
cb();
111100
});
101+
cp.on('exit', function (code) {
102+
cmdCode = code;
103+
});
112104
};
113105

114106
if (endpoint) {

0 commit comments

Comments
 (0)