fix(core): Fixes issues with tests and Node v6 (#1458)

Fixes issues with Mocha tests and Node v6.

Related to #1455
This commit is contained in:
Mikael Korpela
2016-08-28 14:30:27 +03:00
committed by Liran Tal
parent 99c64cf7ca
commit c35713d352
3 changed files with 11 additions and 9 deletions

View File

@@ -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();
});
});
});

View File

@@ -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'),
@@ -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 /');

View File

@@ -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",
@@ -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",
@@ -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"
}