From 4862bb762e1e85d683970190d9bdf9e9d5996215 Mon Sep 17 00:00:00 2001 From: potato Date: Mon, 9 Mar 2020 14:44:47 +0800 Subject: [PATCH 1/2] Add new category concurrency Some problems is in category concurrency, missing concurrency category will make some problems disappear in list commands. You can try problem 1114, which is missing without concurrency. --- lib/config.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/config.js b/lib/config.js index 9fc26945..ed390f04 100644 --- a/lib/config.js +++ b/lib/config.js @@ -10,7 +10,8 @@ const DEFAULT_CONFIG = { categories: [ 'algorithms', 'database', - 'shell' + 'shell', + 'concurrency' ], langs: [ 'bash', From 8f2aecda5415b6790540296768577e3b5e517364 Mon Sep 17 00:00:00 2001 From: johnson Date: Thu, 12 Mar 2020 17:23:32 +0800 Subject: [PATCH 2/2] fixing testing for new category --- docs/commands.md | 1 + test/plugins/test_leetcode.js | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/commands.md b/docs/commands.md index 77304431..9b147707 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -141,6 +141,7 @@ Navigate the quations. * `algorithms` * `database` * `shell` + * `concurrency` * by company (require plugin) * by topic (require plugin) * `-s` to show statistic counters of the output list. diff --git a/test/plugins/test_leetcode.js b/test/plugins/test_leetcode.js index d4e7a3e9..7fa2363c 100644 --- a/test/plugins/test_leetcode.js +++ b/test/plugins/test_leetcode.js @@ -121,9 +121,13 @@ describe('plugin:leetcode', function() { .get('/api/problems/shell/') .replyWithFile(200, './test/mock/problems.json.20160911'); + nock('https://leetcode.com') + .get('/api/problems/concurrency/') + .replyWithFile(200, './test/mock/problems.json.20160911'); + plugin.getProblems(function(e, problems) { assert.equal(e, null); - assert.equal(problems.length, 377 * 3); + assert.equal(problems.length, 377 * 4); done(); }); }); @@ -141,6 +145,10 @@ describe('plugin:leetcode', function() { .get('/api/problems/shell/') .replyWithFile(200, './test/mock/problems.json.20160911'); + nock('https://leetcode.com') + .get('/api/problems/concurrency/') + .replyWithFile(200, './test/mock/problems.json.20160911'); + plugin.getProblems(function(e, problems) { assert.equal(e.message, 'unknown error'); done();