feat(pkg): error handling

This commit is contained in:
DIYgod
2019-09-19 18:15:51 +08:00
parent 2aa847c71c
commit 7bdda509fe
4 changed files with 28 additions and 24 deletions

View File

@@ -1,14 +1,9 @@
const supertest = require('supertest');
const Parser = require('rss-parser');
const parser = new Parser();
let server;
async function checkBlock(response) {
expect(response.status).toBe(403);
expect(await parser.parseString(response.text)).toMatchObject({
items: [],
title: '没有访问权限. Access denied.',
});
expect(response.text).toMatch(/Access denied\./);
}
afterEach(() => {