Skip to content
This repository was archived by the owner on Aug 30, 2021. It is now read-only.

Commit c35713d

Browse files
simisonlirantal
authored andcommitted
fix(core): Fixes issues with tests and Node v6 (#1458)
Fixes issues with Mocha tests and Node v6. Related to #1455
1 parent 99c64cf commit c35713d

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

modules/articles/tests/server/article.server.model.tests.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,18 @@ describe('Article Model Unit Tests:', function () {
4343
describe('Method Save', function () {
4444
it('should be able to save without problems', function (done) {
4545
this.timeout(10000);
46-
return article.save(function (err) {
46+
article.save(function (err) {
4747
should.not.exist(err);
48-
done();
48+
return done();
4949
});
5050
});
5151

5252
it('should be able to show an error when try to save without title', function (done) {
5353
article.title = '';
5454

55-
return article.save(function (err) {
55+
article.save(function (err) {
5656
should.exist(err);
57-
done();
57+
return done();
5858
});
5959
});
6060
});

modules/users/tests/server/user.server.routes.tests.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict';
22

3-
var should = require('should'),
3+
var semver = require('semver'),
4+
should = require('should'),
45
request = require('supertest'),
56
path = require('path'),
67
mongoose = require('mongoose'),
@@ -104,7 +105,7 @@ describe('User CRUD tests', function () {
104105

105106
// NodeJS v4 changed the status code representation so we must check
106107
// before asserting, to be comptabile with all node versions.
107-
if (process.version.indexOf('v4') === 0 || process.version.indexOf('v5') === 0) {
108+
if (semver.satisfies(process.versions.node, '>=4.0.0')) {
108109
signoutRes.text.should.equal('Found. Redirecting to /');
109110
} else {
110111
signoutRes.text.should.equal('Moved Temporarily. Redirecting to /');

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"lodash": "~4.6.1",
5757
"lusca": "~1.3.0",
5858
"method-override": "~2.3.5",
59-
"mocha": "~2.5.0",
59+
"mocha": "~3.0.2",
6060
"mongoose": "~4.4.8",
6161
"morgan": "~1.7.0",
6262
"multer": "~1.1.0",
@@ -111,7 +111,7 @@
111111
"gulp-less": "~3.0.5",
112112
"gulp-livereload": "~3.8.1",
113113
"gulp-load-plugins": "~1.2.0",
114-
"gulp-mocha": "~2.2.0",
114+
"gulp-mocha": "~3.0.1",
115115
"gulp-ng-annotate": "~1.1.0",
116116
"gulp-nodemon": "~2.0.6",
117117
"gulp-protractor": "~2.1.0",
@@ -129,9 +129,10 @@
129129
"karma-ng-html2js-preprocessor": "~0.2.1",
130130
"karma-phantomjs-launcher": "~1.0.0",
131131
"load-grunt-tasks": "~3.4.1",
132-
"mock-fs": "~3.7.0",
132+
"mock-fs": "~3.11.0",
133133
"node-inspector": "~0.12.7",
134134
"run-sequence": "~1.1.5",
135+
"semver": "~5.3.0",
135136
"should": "~8.2.2",
136137
"supertest": "~1.2.0"
137138
}

0 commit comments

Comments
 (0)