From 3701328839ae9eca69e65f42d32ef97136b7d943 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Fri, 11 Jan 2019 16:31:08 +0800 Subject: [PATCH] more test cases --- package.json | 2 +- test/cases.js | 407 ++++++++++++++++++++++++++++++++++++++++++++++++ test/cases.json | 16 -- test/index.js | 1 + 4 files changed, 409 insertions(+), 17 deletions(-) create mode 100644 test/cases.js delete mode 100644 test/cases.json create mode 100644 test/index.js diff --git a/package.json b/package.json index c4432b34b..17a8d0bcc 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ }, "jest": { "testMatch": [ - "**/test/*.js" + "**/test/index.js" ], "coverageReporters": [ "text-summary", diff --git a/test/cases.js b/test/cases.js new file mode 100644 index 000000000..e048cce58 --- /dev/null +++ b/test/cases.js @@ -0,0 +1,407 @@ +module.exports = { + text: ['/'], + rss: [ + '/bilibili/bangumi/21680', + '/bilibili/user/video/2267573', + '/bilibili/user/article/334958638', + '/bilibili/user/dynamic/2267573', + '/bilibili/user/channel/142821407/49017', + '/bilibili/user/fav/2267573', + '/bilibili/fav/756508/50948568', + '/bilibili/user/coin/2267573', + '/bilibili/user/followers/2267573', + '/bilibili/user/followings/2267573', + '/bilibili/partion/33', + '/bilibili/partion/ranking/171/3', + '/bilibili/video/reply/21669336', + '/bilibili/link/news/live', + '/bilibili/blackboard', + '/bilibili/mall/new', + '/bilibili/mall/ip/1_5883', + '/bilibili/ranking/0/3', + '/bilibili/topic/2233', + '/bilibili/audio/10624', + '/weibo/user/1195230310', + '/weibo/user2/1195230310', + '/weibo/keyword/DIYgod', + '/weibo/search/hot', + '/tieba/forum/%E5%A5%B3%E5%9B%BE', + '/tieba/forum/good/%E5%A5%B3%E5%9B%BE', + '/tieba/post/5853240586', + '/tieba/post/lz/5853240586', + '/jike/topic/54dffb40e4b0f57466e675f0', + '/jike/topic/square/54dffb40e4b0f57466e675f0', + '/jike/topic/text/553870e8e4b0cafb0a1bef68', + '/jike/user/82D23B32-CF36-4C59-AD6F-D05E3552CBF3', + '/jike/daily', + '/jike/topic/584b8ac671a288001154a115', + '/wechat/wasi/:id', + '/wechat/announce', + '/wechat/miniprogram/plugins', + '/jianshu/home', + '/jianshu/trending/weekly', + '/jianshu/collection/xYuZYD', + '/jianshu/user/yZq3ZV', + '/zhihu/collection/26444956', + '/zhihu/people/activities/diygod', + '/zhihu/people/answers/diygod', + '/zhihu/zhuanlan/googledevelopers', + '/zhihu/daily', + '/zhihu/hotlist', + '/zhihu/pin/hotlist', + '/zhihu/question/59895982', + '/zhihu/topic/19828946', + '/zhihu/people/pins/kan-dan-45', + '/zhihu/bookstore/newest', + '/zhihu/pin/daily', + '/pixiv/user/bookmarks/15288095', + '/pixiv/user/11', + '/pixiv/ranking/week', + '/pixiv/search/%E9%BA%BB%E8%A1%A3/popular', + '/douban/movie/playing', + '/douban/movie/playing/7.5/%E6%9D%AD%E5%B7%9E', + '/douban/movie/later', + '/douban/movie/ustop', + '/douban/group/camera', + '/douban/explore', + '/douban/book/latest', + '/douban/music/latest/chinese', + '/douban/event/hot/118172', + '/douban/commercialpress/latest', + '/douban/bookstore', + '/douban/book/rank/fiction', + '/disqus/posts/diygod-me', + '/twitter/user/DIYgod', + '/twitter/list/ladyleet/javascript', + '/instagram/user/diygod', + '/youtube/user/JFlaMusic/', + '/youtube/channel/UCDwDMPOZfxVV0x_dz0eQ8KQ', + '/youtube/playlist/PLqQ1RwlxOgeLTJ1f3fNMSwhjVgaWKo_9Z', + '/dribbble/popular/week', + '/dribbble/user/google', + '/dribbble/keyword/player', + '/telegram/channel/awesomeDIYgod', + '/telegram/stickerpack/DIYgod', + '/douyin/user/93610979153', + '/xueqiu/user/8152922548', + '/xueqiu/favorite/8152922548', + '/xueqiu/user_stock/1247347556', + '/xueqiu/fund/040008', + '/ltaaa', + '/nga/forum/485', + '/nga/post/15939161', + '/facebook/page/SonetPCR', + '/bihu/activaties/1478342200', + '/juejin/category/frontend', + '/juejin/tag/%E6%9E%B6%E6%9E%84', + '/juejin/trending/ios/monthly', + '/juejin/books', + '/juejin/pins', + '/dockone/weekly', + '/toutiao/today', + '/toutiao/user/140544', + '/zcfy', + '/zcfy/hot', + '/v2ex/topics/latest', + '/github/repos/DIYgod', + '/github/trending/daily/javascript', + '/github/issue/DIYgod/RSSHub', + '/github/user/followers/HenryQW', + '/github/stars/DIYgod/RSSHub', + '/github/search/RSSHub/bestmatch/desc', + '/oschina/news', + '/gitlab/explore/trending', + '/geektime/column/48', + '/aqk/vul', + '/aqk/week', + '/linkedkeeper/sub/1', + '/pediy/topic/android/digest', + '/gameinstitute/community/hot', + '/miniapp/article/cloud', + '/miniapp/store/newest', + '/blogread/newest', + '/gitchat/newest', + '/gitea/blog', + '/testerhome/newest', + '/patchwork.kernel.org/comments/10723629', + '/bilibili/live/room/3', + '/bilibili/live/search/%E7%BC%96%E7%A8%8B/online', + '/bilibili/live/area/143/online', + '/douyu/room/24422', + '/panda/room/10300', + '/huya/live/edmunddzhang', + '/ncm/playlist/35798529', + '/ncm/user/playlist/45441555', + '/ncm/artist/2116', + '/ncm/djradio/347317067', + '/iqiyi/dongman/a_19rrh1sifx', + '/tencentvideo/playlist/jx7g4sm320sqm7i', + '/ximalaya/album/299146', + '/eztv/torrents/6048596', + '/t66y/20/2', + '/t66y/post/3286088', + '/sexinsex/230/634', + '/dysfz', + '/dytt', + '/youku/channel/UNTg3MTM3OTcy', + '/acfun/bangumi/5022158', + '/zimuzu/resource/37031', + '/sankakucomplex/post', + '/mzitu/home', + '/mzitu/category/hot', + '/mzitu/tags', + '/mzitu/tag/shishen', + '/mzitu/post/129452', + '/dbmv', + '/jandan/pic', + '/jandan/ooxx', + '/dapenti/tugua', + '/dapenti/subject/184', + '/konachan/post/popular_recent', + '/yande.re/post/popular_recent', + '/pigtails', + '/tits-guru/home', + '/tits-guru/daily', + '/tits-guru/model/mila-azul', + '/tits-guru/category/bikini', + '/nhentai/language/chinese', + '/nhentai/search/language%3Ajapanese+-scat+-yaoi+-guro+-%22mosaic+censorship%22', + '/bangumi/calendar/today', + '/bangumi/subject/240038', + '/bangumi/subject/214265/comments?minLength=100', + '/bangumi/subject/214265/blogs', + '/bangumi/subject/214265/topics', + '/bangumi/person/32943', + '/bangumi/topic/24657', + '/bangumi/group/boring', + '/mmgal', + '/manhuagui/comic/22942', + '/anime1/anime/2018%E5%B9%B4%E7%A7%8B%E5%AD%A3/%E5%93%A5%E5%B8%83%E6%9E%97%E6%AE%BA%E6%89%8B', + '/anime1/search/%E5%85%94%E5%A5%B3%E9%83%8E%E5%AD%B8%E5%A7%8A', + '/anigamer/new_anime', + '/anigamer/anime/90003', + '/rsshub/rss', + '/miui/aries', + '/firefox/release/desktop', + '/thunderbird/release', + '/qcloud/mlvb/changelog', + '/bugly/changelog/1', + '/fir/update/xcz', + '/nvidia/webdriverupdate', + '/appstore/update/cn/id444934666', + '/appstore/price/cn/mac/id1152443474', + '/appstore/iap/cn/id953286746', + '/appstore/xianmian', + '/fdroid/apprelease/com.termux', + '/greasyfork/zh-CN/bilibili.com', + '/curseforge/files/jei', + '/xclient/app/sketch', + '/typora/changelog', + '/apkpure/versions/jp/jp.co.craftegg.band', + '/shmtu/events', + '/shmtu/notes', + '/shmtu/jwc/1', + '/swust/jwc/news', + '/swust/jwc/notice/1', + '/swust/cs/1', + '/pku/eecs/0', + '/scnu/jw', + '/scnu/library', + '/scnu/cs/match', + '/ju/jwc/all', + '/dpu/jiaowu/news/2', + '/dpu/wlfw/news/2', + '/seu/radio/academic', + '/seu/yzb/1', + '/seu/cse/xyxw', + '/nuaa/jwc/all', + '/nuaa/cs/kydt', + '/hit/jwc', + '/shanghaitech/sist/activity', + '/sjtu/seiee/academic', + '/sjtu/seiee/bjwb/major_select', + '/sjtu/seiee/bjwb/major_transfer', + '/sjtu/seiee/bjwb/abroad', + '/sjtu/seiee/bjwb/postgraduate', + '/sjtu/seiee/bjwb/international', + '/sjtu/gs/tzgg/pyxx', + '/sjtu/seiee/xsb/news', + '/cas/sim/academic', + '/njupt/jwc/notice', + '/nchu/jwc/notice', + '/heu/ugs/news/jwc/jxap', + '/cqu/jwc/announcement', + '/nuist/bulletin/791', + '/nuist/scs/2242', + '/nuist/jwc/1', + '/nuist/yjs/11', + '/nuist/xgc', + '/nuist/sese/11', + '/nuist/cas/12', + '/nuist/lib', + '/cuit/cxxww/1', + '/cqust/jw/notify', + '/cqust/lib/news', + '/cczu/jwc/1425', + '/cczu/news/6620', + '/njust/jwc/1', + '/njust/cwc/1', + '/njust/gs/1', + '/sctu/xgxy', + '/sctu/xgxy/652', + '/sctu/jwc/13', + '/sctu/jwc/13/645', + '/uestc/jwc/student', + '/uestc/news/culture', + '/kmust/jwc/notify', + '/kmust/job/careers/inner', + '/kmust/job/jobfairs', + '/hust/auto/notice/0', + '/hust/auto/news', + '/sdu/grad/academic', + '/sdu/sc/0', + '/sdu/cmse/0', + '/sdu/mech/0', + '/sdu/epe/0', + '/dlu/jiaowu/news', + '/xidian/jwc/xxfb', + '/dgut/jwc/', + '/dgut/xsc/', + '/tju/sse/xwdt', + '/scut/jwc/1', + '/sysu/sdcs', + '/cpu/home', + '/wzbc/notice', + '/henu/xszl', + '/nku/jwc/1', + '/cctv/world', + '/caixin/finance/regulation', + '/infzm/5', + '/nytimes', + '/nytimes/morning_post', + '/bjnews/realtime', + '/thepaper/featured', + '/thepaper/channel/27224', + '/zaobao/realtime/china', + '/zaobao/znews/greater-china', + '/nhk/news_web_easy', + '/bbc/chinese', + '/ft/chinese/hotstoryby7day', + '/guardian/editorial', + '/guardian/china', + '/dwnews/yaowen/global', + '/dwnews/rank/photo/7', + '/solidot/linux', + '/geekpark/breakingnews', + '/tingshuitz/hangzhou', + '/tingshuitz/xiaoshan', + '/tingshuitz/dalian', + '/tingshuitz/guangzhou', + '/tingshuitz/dongguan', + '/tingdiantz/95598/36401/36101', + '/weatheralarm', + '/earthquake', + '/hko/weather', + '/atfd/us+new%20york,gb+london/1', + '/imuseum/shanghai/all', + '/hopper/1/LHR/PEK', + '/mafengwo/note/hot', + '/namoc/announcement', + '/natgeo/news/ngnews', + '/smzdm/keyword/%E5%A5%B3%E8%A3%85', + '/smzdm/ranking/pinlei/11/3', + '/mi/crowdfunding', + '/mi/youpin/crowdfunding', + '/mi/youpin/new', + '/dgtle/trade/111', + '/westore/new', + '/coolbuy/newest', + '/jingdong/zhongchou/all/zcz/zhtj', + '/3dm/news', + '/3dm/detroitbecomehuman/news', + '/mihoyo/bh2/gach', + '/mihoyo/bh3/strategy', + '/kirara/news', + '/lfsyd/1', + '/gnn/gnn', + '/a9vg/a9vg', + '/steam/search/specials=1&term=atelier', + '/steam/news/282800', + '/guanzhi', + '/novel/biquge/52_52542', + '/novel/uukanshu/49621>', + '/novel/wenxuemi/6/6144', + '/qidian/chapter/1010400217', + '/qidian/forum/1010400217', + '/zongheng/chapter/672340', + '/ciweimao/chapter/100045750', + '/novel/booksky/98619', + '/aozora/newbook/10', + '/embassy/us', + '/embassy/us/chicago', + '/ziroom/room/sh/1/2/%E4%BA%94%E8%A7%92%E5%9C%BA', + '/express/youzhengguoji/CV054432809US', + '/tucaoqq/post/28564/CdRI0728', + '/jinritoutiao/keyword/AI', + '/readhub/category/topic', + '/gcores/category/1', + '/one', + '/hexo/next/fengkx.top', + '/keep/user/556b02c1ab59390afea671ea', + '/dongqiudi/daily', + '/dongqiudi/result/50001755', + '/dongqiudi/team_news/50001755', + '/dongqiudi/player_news/50000339', + '/wikipedia/mainland', + '/google/scholar/data+visualization', + '/google/doodles/zh-CN', + '/guokr/scientific', + '/tuicool/mags/tech', + '/ifanr/app', + '/apple/exchange_repair', + '/sspai/series', + '/sspai/shortcuts', + '/qutoutiao/category/1', + '/verge', + '/houxu/events/38', + '/laosiji/feed', + '/laosiji/hot', + '/laosiji/hotshow/128', + '/99percentinvisible/transcript', + '/dajia', + '/chouti/hot', + '/oilprice/shanghai', + '/autotrader/radius=50&postcode=sw1a1aa&onesearchad=Used&onesearchad=Nearly%20New&onesearchad=New&price-to=9000&year-from=2012&body-type=Hatchback&transmission=Automatic&exclude-writeoff-categories=on', + '/un/scveto', + '/baidu/doodles', + '/baidu/topwords/1', + '/sogou/doodles', + '/itjuzi/invest', + '/itjuzi/merge', + '/tanwu/products', + '/xiachufang/user/cooked/103309404', + '/xiachufang/user/created/103309404', + '/xiachufang/popular/hot', + '/eeo/15', + '/tssstatus/j42dap/14W585a', + '/iDownloadBlog', + '/9to5/mac', + '/weseepro/newest', + '/weseepro/circle', + '/javbus/home', + '/javbus/genre/7g', + '/javbus/star/2jv', + '/javbus/uncensored/home', + '/javbus/uncensored/genre/1bc', + '/javbus/uncensored/star/b5b', + '/javbus/western/home', + '/javbus/western/genre/86', + '/javbus/western/star/4hv', + '/huxiu/tag/291', + '/huxiu/search/%E8%99%8E%E5%97%85%E6%97%A9%E6%8A%A5', + '/shanbay/checkin/ddwej', + '/36kr/search/article/8%E7%82%B91%E6%B0%AA', + '/icourse163/newest', + '/qdaily', + ], +}; diff --git a/test/cases.json b/test/cases.json deleted file mode 100644 index 749944c48..000000000 --- a/test/cases.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "text": ["/"], - "rss": [ - "/rsshub/rss", - "/bilibili/bangumi/21680", - "/weibo/user/1195230310", - "/weibo/user2/1195230310", - "/weibo/keyword/rsshub", - "/weibo/search/hot", - "/bangumi/subject/240038", - "/bangumi/calendar/today", - "/bangumi/subject/240038/comments?minLength=100", - "/bangumi/subject/240038/blogs", - "/bangumi/subject/240038/topics" - ] -} diff --git a/test/index.js b/test/index.js new file mode 100644 index 000000000..8b2dc0c91 --- /dev/null +++ b/test/index.js @@ -0,0 +1 @@ +require('./response');