🐛 tests: integration test for api notifications failed sometimes

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
This commit is contained in:
kirrg001 2017-02-07 20:58:03 +01:00
parent f4f562b6db
commit a1cb8e8c58
2 changed files with 10 additions and 1 deletions

View File

@ -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',

View File

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