From a1cb8e8c5847ce034d42527acf9e3db698cb0a3a Mon Sep 17 00:00:00 2001 From: kirrg001 Date: Tue, 7 Feb 2017 20:58:03 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=20tests:=20integration=20test?= =?UTF-8?q?=20for=20api=20notifications=20failed=20sometimes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit no issue - sometimes the integration test for api notifications failed - this was caused because multiple tests are using the notifications API, which has a local notification store - we need to ensure that tests, who add notifications to this store, reset the store after it's test iteration --- core/test/integration/api/api_notifications_spec.js | 4 ++++ core/test/integration/update_check_spec.js | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/core/test/integration/api/api_notifications_spec.js b/core/test/integration/api/api_notifications_spec.js index 32da96e10c..f3b19e71b3 100644 --- a/core/test/integration/api/api_notifications_spec.js +++ b/core/test/integration/api/api_notifications_spec.js @@ -13,6 +13,10 @@ describe('Notifications API', function () { should.exist(NotificationsAPI); + after(function () { + return NotificationsAPI.destroyAll(testUtils.context.internal); + }); + it('can add, adds defaults (internal)', function (done) { var msg = { type: 'info', diff --git a/core/test/integration/update_check_spec.js b/core/test/integration/update_check_spec.js index 22c5fb041b..bd779af58c 100644 --- a/core/test/integration/update_check_spec.js +++ b/core/test/integration/update_check_spec.js @@ -1,14 +1,18 @@ var _ = require('lodash'), - testUtils = require('../utils'), should = require('should'), rewire = require('rewire'), uuid = require('uuid'), + testUtils = require('../utils'), configUtils = require('../utils/configUtils'), packageInfo = require('../../../package'), updateCheck = rewire('../../server/update-check'), NotificationsAPI = require('../../server/api/notifications'); describe('Update Check', function () { + after(function () { + return NotificationsAPI.destroyAll(testUtils.context.internal); + }); + describe('Reporting to UpdateCheck', function () { before(function () { configUtils.set('privacy:useUpdateCheck', true); @@ -40,6 +44,7 @@ describe('Update Check', function () { data.post_count.should.be.above(0); data.npm_version.should.be.a.String(); data.npm_version.should.not.be.empty(); + data.lts.should.eql(false); done(); }).catch(done);