feat: error page

This commit is contained in:
DIYgod
2019-09-04 16:00:00 +08:00
parent dc37a779e4
commit 24cab914d8
7 changed files with 63 additions and 11 deletions
+2 -2
View File
@@ -10,7 +10,7 @@ describe('error', () => {
it(`error`, async () => {
const response = await request.get('/test/error');
expect(response.status).toBe(404);
expect(response.text).toMatch(/Looks like something went wrong in RSSHub: <pre>Error: Error test/);
expect(response.text).toMatch(/Error: Error test/);
});
});
@@ -19,7 +19,7 @@ describe('httperror', () => {
const response = await request.get('/test/httperror');
expect(response.status).toBe(404);
expect(response.text).toMatch(
/Looks like something went wrong in RSSHub: <pre>Response code 404 \(Not Found\): target website might be blocking our access, you can <a href="https:\/\/docs\.rsshub\.app\/install\/">host your own RSSHub instance<\/a> for a better usability\./
/Response code 404 \(Not Found\): target website might be blocking our access, you can <a href="https:\/\/docs\.rsshub\.app\/install\/">host your own RSSHub instance<\/a> for a better usability\./
);
});
});
+2 -2
View File
@@ -110,7 +110,7 @@ describe('empty', () => {
it(`empty`, async () => {
const response1 = await request.get('/test/empty');
expect(response1.status).toBe(404);
expect(response1.text).toMatch(/Looks like something went wrong in RSSHub: <pre>Error: this route is empty/);
expect(response1.text).toMatch(/Error: this route is empty/);
const response2 = await request.get('/test/1?limit=0');
expect(response2.status).toBe(200);
@@ -132,7 +132,7 @@ describe('wrong_path', () => {
it(`wrong_path`, async () => {
const response = await request.get('/wrong');
expect(response.status).toBe(404);
expect(response.text).toMatch(/Looks like something went wrong in RSSHub: <pre>Error: wrong path/);
expect(response.text).toMatch(/Error: wrong path/);
});
});
+1 -1
View File
@@ -60,7 +60,7 @@ describe('template', () => {
it(`.json`, async () => {
const response = await request.get('/test/1.json');
expect(response.status).toBe(404);
expect(response.text).toMatch(/Looks like something went wrong in RSSHub: <pre>Error: <b>JSON output had been removed/);
expect(response.text).toMatch(/Error: <b>JSON output had been removed/);
});
it(`long title`, async () => {