Skip to content

Commit 2c97903

Browse files
sinchangJacksonTian
authored andcommitted
test: add rss unit test
1 parent c6edca7 commit 2c97903

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/app/controller/rss.test.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
'use strict';
2+
3+
const { app, assert } = require('egg-mock/bootstrap');
4+
5+
describe('test/app/controller/rss.test.js', () => {
6+
it('rss should ok', async () => {
7+
const { config } = app;
8+
config.debug = false;
9+
const result1 = await app.httpRequest().get('/rss');
10+
assert(result1.text.includes('CNode:Node.js专业中文社区'));
11+
12+
const result2 = await app.httpRequest().get('/rss');
13+
assert(result2.text.includes('CNode:Node.js专业中文社区'));
14+
15+
config.rss = null;
16+
await app.httpRequest().get('/rss').expect(404);
17+
config.debug = true;
18+
});
19+
});

0 commit comments

Comments
 (0)