diff --git a/Gruntfile.js b/Gruntfile.js index 5cb4cce5ab..44dc03700d 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -230,10 +230,10 @@ var _ = require('lodash'), }, coverage_all: { src: [ - 'core/test/unit', - 'core/server/apps', 'core/test/integration', - 'core/test/functional' + 'core/server/apps', + 'core/test/functional', + 'core/test/unit' ], options: { coverageFolder: 'core/test/coverage/all', diff --git a/core/test/functional/routes/channel_spec.js b/core/test/functional/routes/channel_spec.js index 4d60c6313d..302aa49fed 100644 --- a/core/test/functional/routes/channel_spec.js +++ b/core/test/functional/routes/channel_spec.js @@ -232,6 +232,8 @@ describe('Channel Routes', function () { }).catch(done); }); + after(testUtils.teardown); + it('should 404 for /tag/ route', function (done) { request.get('/tag/') .expect('Cache-Control', testUtils.cacheRules.private) diff --git a/core/test/unit/config_spec.js b/core/test/unit/config_spec.js index 3f83e3baca..b16c00491d 100644 --- a/core/test/unit/config_spec.js +++ b/core/test/unit/config_spec.js @@ -17,6 +17,10 @@ var should = require('should'), i18n.init(); describe('Config', function () { + before(function () { + configUtils.restore(); + }); + afterEach(function () { configUtils.restore(); }); diff --git a/core/test/utils/fixtures/data-generator.js b/core/test/utils/fixtures/data-generator.js index e6d3226f98..173127a7ef 100644 --- a/core/test/utils/fixtures/data-generator.js +++ b/core/test/utils/fixtures/data-generator.js @@ -245,7 +245,9 @@ DataGenerator.forKnex = (function () { clients; function createBasic(overrides) { - return _.defaults(overrides, { + var newObj = _.cloneDeep(overrides); + + return _.defaults(newObj, { uuid: uuid.v4(), created_by: 1, created_at: new Date(), @@ -255,7 +257,9 @@ DataGenerator.forKnex = (function () { } function createPost(overrides) { - return _.defaults(overrides, { + var newObj = _.cloneDeep(overrides); + + return _.defaults(newObj, { uuid: uuid.v4(), status: 'published', html: overrides.markdown, @@ -291,7 +295,9 @@ DataGenerator.forKnex = (function () { } function createUser(overrides) { - return _.defaults(overrides, { + var newObj = _.cloneDeep(overrides); + + return _.defaults(newObj, { uuid: uuid.v4(), status: 'active', created_by: 1, @@ -316,7 +322,9 @@ DataGenerator.forKnex = (function () { } function createAppField(overrides) { - return _.defaults(overrides, { + var newObj = _.cloneDeep(overrides); + + return _.defaults(newObj, { uuid: uuid.v4(), created_by: 1, created_at: new Date(), @@ -328,7 +336,9 @@ DataGenerator.forKnex = (function () { } function createAppSetting(overrides) { - return _.defaults(overrides, { + var newObj = _.cloneDeep(overrides); + + return _.defaults(newObj, { uuid: uuid.v4(), app_id: 1, created_by: 1, @@ -337,7 +347,9 @@ DataGenerator.forKnex = (function () { } function createToken(overrides) { - return _.defaults(overrides, { + var newObj = _.cloneDeep(overrides); + + return _.defaults(newObj, { token: uuid.v4(), client_id: 1, expires: Date.now() + globalUtils.ONE_DAY_MS