Clear blacklist after tests
This commit is contained in:
parent
4b3f606d7d
commit
4e31fd02cf
|
@ -1,5 +1,6 @@
|
||||||
const request = require('supertest')
|
const request = require('supertest')
|
||||||
const createServer = require('../createServer')
|
const createServer = require('../createServer')
|
||||||
|
const clearBlacklist = require('./utils/clearBlacklist')
|
||||||
const withBlacklist = require('./utils/withBlacklist')
|
const withBlacklist = require('./utils/withBlacklist')
|
||||||
const withRevokedToken = require('./utils/withRevokedToken')
|
const withRevokedToken = require('./utils/withRevokedToken')
|
||||||
const withToken = require('./utils/withToken')
|
const withToken = require('./utils/withToken')
|
||||||
|
@ -115,6 +116,8 @@ describe('The server', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('POST /_blacklist', () => {
|
describe('POST /_blacklist', () => {
|
||||||
|
afterEach(clearBlacklist)
|
||||||
|
|
||||||
describe('with no auth', () => {
|
describe('with no auth', () => {
|
||||||
it('is forbidden', done => {
|
it('is forbidden', done => {
|
||||||
request(server)
|
request(server)
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
const BlacklistAPI = require('../../BlacklistAPI')
|
||||||
|
|
||||||
|
function clearBlacklist(done) {
|
||||||
|
BlacklistAPI.removeAllPackages().then(done, done)
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = clearBlacklist
|
Loading…
Reference in New Issue