You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please remember to add this file to your `.gitignore`!
53
-
Calling `zulip({ zuliprc: 'zuliprc' } )` will read this file and then pass a configured zulip object to `.then()`.
59
+
Please remember to add this file to your `.gitignore`! Calling `zulip({ zuliprc: 'zuliprc' } )` will read this file and then pass a configured zulip object to `.then()`.
54
60
55
61
```js
56
62
constzulip=require('zulip-js');
57
63
constpath=require('path');
58
64
constzuliprc=path.resolve(__dirname, 'zuliprc');
59
-
zulip({ zuliprc }).then(zulip=> {
65
+
zulip({ zuliprc }).then((zulip)=> {
60
66
// The zulip object now contains the config from the zuliprc file
|`zulip.accounts.retrieve()`| POST `/fetch_api_key`| returns a promise that you can use to retrieve your `API key`. |
99
105
|`zulip.emojis.retrieve()`| GET `/realm/emoji`| retrieves the list of realm specific emojis. |
100
106
|`zulip.events.retrieve()`| GET `/events`| retrieves events from a queue. You can pass it a params object with the id of the queue you are interested in, the last event id that you have received and wish to acknowledge. You can also specify whether the server should not block on this request until there is a new event (the default is to block). |
101
-
|`zulip.messages.send()`| POST `/messages`| returns a promise that can be used to send a message.|
107
+
|`zulip.messages.send()`| POST `/messages`| returns a promise that can be used to send a message.|
102
108
|`zulip.messages.retrieve()`| GET `/messages`| returns a promise that can be used to retrieve messages from a stream. You need to specify the id of the message to be used as an anchor. Use `1000000000` to retrieve the most recent message, or [`zulip.users.me.pointer.retrieve()`](#fetching-a-pointer-for-a-user) to get the id of the last message the user read. |
103
109
|`zulip.messages.render()`| POST `/messages/render`| returns a promise that can be used to get rendered HTML for a message text. |
104
110
|`zulip.messages.update()`| PATCH `/messages/<msg_id>`| updates the content or topic of the message with the given `msg_id`. |
@@ -135,9 +141,7 @@ Use `npm test` to run the tests.
135
141
136
142
## Writing Tests
137
143
138
-
Currently, we have a simple testing framework which stubs our network
139
-
requests and also allows us to test the input passed to it. This is what
140
-
a sample test for an API endpoint looks like:
144
+
Currently, we have a simple testing framework which stubs our network requests and also allows us to test the input passed to it. This is what a sample test for an API endpoint looks like:
141
145
142
146
```js
143
147
constchai=require('chai');
@@ -153,18 +157,22 @@ describe('Users', () => {
153
157
subject:'test',
154
158
content:'sample test',
155
159
};
156
-
constvalidator= (url, options) => { // Function to test the network request parameters.
160
+
constvalidator= (url, options) => {
161
+
// Function to test the network request parameters.
0 commit comments