mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
feat: error page
This commit is contained in:
@@ -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\./
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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/);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user