1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 02:09:37 +02:00

Add auto mute plugin tests

This commit is contained in:
Chocobozzz 2020-05-07 16:32:54 +02:00
parent faf174d043
commit 8bff1fe009
No known key found for this signature in database
GPG key ID: 583A612D890159BE
4 changed files with 150 additions and 0 deletions

View file

@ -0,0 +1,28 @@
import * as express from 'express'
type BlocklistResponse = {
data: {
value: string
action?: 'add' | 'remove'
}[]
}
export class MockBlocklist {
private body: BlocklistResponse
initialize () {
return new Promise(res => {
const app = express()
app.get('/blocklist', (req: express.Request, res: express.Response) => {
return res.json(this.body)
})
app.listen(42100, () => res())
})
}
replace (body: BlocklistResponse) {
this.body = body
}
}