Clear blacklist after tests

This commit is contained in:
MICHAEL JACKSON 2017-11-14 16:46:59 -08:00
parent 4b3f606d7d
commit 4e31fd02cf
2 changed files with 10 additions and 0 deletions

View File

@ -1,5 +1,6 @@
const request = require('supertest')
const createServer = require('../createServer')
const clearBlacklist = require('./utils/clearBlacklist')
const withBlacklist = require('./utils/withBlacklist')
const withRevokedToken = require('./utils/withRevokedToken')
const withToken = require('./utils/withToken')
@ -115,6 +116,8 @@ describe('The server', () => {
})
describe('POST /_blacklist', () => {
afterEach(clearBlacklist)
describe('with no auth', () => {
it('is forbidden', done => {
request(server)

View File

@ -0,0 +1,7 @@
const BlacklistAPI = require('../../BlacklistAPI')
function clearBlacklist(done) {
BlacklistAPI.removeAllPackages().then(done, done)
}
module.exports = clearBlacklist