Repository: Yoctol/bottender
Pull request #665 (2020-02-26 06:53:15)

fix(whatsapp): export whatsapp routes
This PR exported WhatsApp routes to fix the mistake I made in #664.

codecov-io: # [Codecov](https://codecov.io/gh/Yoctol/bottender/pull/665?src=pr&el=h1) Report
> Merging [#665](https://codecov.io/gh/Yoctol/bottender/pull/665?src=pr&el=desc) into [release/1.3](https://codecov.io/gh/Yoctol/bottender/commit/9e23f239b53894616a42ba710258b3a32a397150?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/Yoctol/bottender/pull/665/graphs/tree.svg?width=650&token=JX3EGtxYH3&height=150&src=pr)](https://codecov.io/gh/Yoctol/bottender/pull/665?src=pr&el=tree)

```diff
@@               Coverage Diff               @@
##           release/1.3     #665      +/-   ##
===============================================
+ Coverage        80.92%   80.93%   +<.01%     
===============================================
  Files              108      108              
  Lines             4478     4480       +2     
  Branches          1109     1109              
===============================================
+ Hits              3624     3626       +2     
  Misses             807      807              
  Partials            47       47
```


| [Impacted Files](https://codecov.io/gh/Yoctol/bottender/pull/665?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [packages/bottender/src/router/index.ts](https://codecov.io/gh/Yoctol/bottender/pull/665/diff?src=pr&el=tree#diff-cGFja2FnZXMvYm90dGVuZGVyL3NyYy9yb3V0ZXIvaW5kZXgudHM=) | `90.78% <100%> (+0.24%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/Yoctol/bottender/pull/665?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/Yoctol/bottender/pull/665?src=pr&el=footer). Last update [9e23f23...186097e](https://codecov.io/gh/Yoctol/bottender/pull/665?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/packages/bottender/src/router/index.ts b/packages/bottender/src/router/index.ts
index da4daf1a..d45bae27 100644
--- a/packages/bottender/src/router/index.ts
+++ b/packages/bottender/src/router/index.ts
@@ -4,6 +4,7 @@ import messenger from '../messenger/routes';
 import slack from '../slack/routes';
 import telegram from '../telegram/routes';
 import viber from '../viber/routes';
+import whatsapp from '../whatsapp/routes';
 import { Action, Client, Event, Props } from '../types';
 
 type MatchPattern = string | Array<string> | RegExp;
@@ -207,4 +208,5 @@ export {
   slack,
   telegram,
   viber,
+  whatsapp,
 };


Test patch:
diff --git a/packages/bottender/src/router/__tests__/router.spec.ts b/packages/bottender/src/router/__tests__/router.spec.ts
index 4c8a1af9..d27defa8 100644
--- a/packages/bottender/src/router/__tests__/router.spec.ts
+++ b/packages/bottender/src/router/__tests__/router.spec.ts
@@ -9,6 +9,7 @@ import router, {
   telegram,
   text,
   viber,
+  whatsapp,
 } from '..';
 
 function textContext(message = '') {
@@ -41,7 +42,7 @@ function platformContext(name = '') {
 }
 
 function sendText(message) {
-  return async function(context) {
+  return async function SendText(context) {
     await context.sendText(message);
   };
 }
@@ -366,3 +367,7 @@ it('#telegram should be exported', () => {
 it('#viber should be exported', () => {
   expect(viber).toBeDefined();
 });
+
+it('#whatsapp should be exported', () => {
+  expect(whatsapp).toBeDefined();
+});