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

Commit

Permalink
fix(core): Fixes issues with tests and Node v6 (#1458)
Browse files Browse the repository at this point in the history
Fixes issues with Mocha tests and Node v6.

Related to #1455
  • Loading branch information
simison authored and lirantal committed Aug 28, 2016
1 parent 99c64cf commit c35713d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
8 changes: 4 additions & 4 deletions modules/articles/tests/server/article.server.model.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,18 @@ describe('Article Model Unit Tests:', function () {
describe('Method Save', function () {
it('should be able to save without problems', function (done) {
this.timeout(10000);
return article.save(function (err) {
article.save(function (err) {
should.not.exist(err);
done();
return done();
});
});

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

return article.save(function (err) {
article.save(function (err) {
should.exist(err);
done();
return done();
});
});
});
Expand Down
5 changes: 3 additions & 2 deletions modules/users/tests/server/user.server.routes.tests.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

var should = require('should'),
var semver = require('semver'),
should = require('should'),
request = require('supertest'),
path = require('path'),
mongoose = require('mongoose'),
Expand Down Expand Up @@ -104,7 +105,7 @@ describe('User CRUD tests', function () {

// NodeJS v4 changed the status code representation so we must check
// before asserting, to be comptabile with all node versions.
if (process.version.indexOf('v4') === 0 || process.version.indexOf('v5') === 0) {
if (semver.satisfies(process.versions.node, '>=4.0.0')) {
signoutRes.text.should.equal('Found. Redirecting to /');
} else {
signoutRes.text.should.equal('Moved Temporarily. Redirecting to /');
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"lodash": "~4.6.1",
"lusca": "~1.3.0",
"method-override": "~2.3.5",
"mocha": "~2.5.0",
"mocha": "~3.0.2",
"mongoose": "~4.4.8",
"morgan": "~1.7.0",
"multer": "~1.1.0",
Expand Down Expand Up @@ -111,7 +111,7 @@
"gulp-less": "~3.0.5",
"gulp-livereload": "~3.8.1",
"gulp-load-plugins": "~1.2.0",
"gulp-mocha": "~2.2.0",
"gulp-mocha": "~3.0.1",
"gulp-ng-annotate": "~1.1.0",
"gulp-nodemon": "~2.0.6",
"gulp-protractor": "~2.1.0",
Expand All @@ -129,9 +129,10 @@
"karma-ng-html2js-preprocessor": "~0.2.1",
"karma-phantomjs-launcher": "~1.0.0",
"load-grunt-tasks": "~3.4.1",
"mock-fs": "~3.7.0",
"mock-fs": "~3.11.0",
"node-inspector": "~0.12.7",
"run-sequence": "~1.1.5",
"semver": "~5.3.0",
"should": "~8.2.2",
"supertest": "~1.2.0"
}
Expand Down

0 comments on commit c35713d

Please sign in to comment.