@@ -138,7 +138,7 @@ Example usage:
138138
139139``` js
140140var strava = require (' strava-v3' );
141- strava .athletes .get ({id: 12345 },function (err ,payload ,limits ) {
141+ strava .athlete .get ({id: 12345 },function (err ,payload ,limits ) {
142142 // do something with your payload, track rate limits
143143});
144144```
@@ -256,26 +256,22 @@ See Strava API docs for returned data structures.
256256* ` strava.athlete.get(args,done) `
257257* ` strava.athlete.update(args,done) ` // only 'weight' can be updated.
258258* ` strava.athlete.listActivities(args,done) ` * Get list of activity summaries*
259- * ` strava.athlete.listRoutes(args,done) `
260259* ` strava.athlete.listClubs(args,done) `
261260* ` strava.athlete.listZones(args,done) `
262261
263262#### Athletes
264263
265- * ` strava.athletes.get(args,done) ` * Get a single activity. args.id is required*
266264* ` strava.athletes.stats(args,done) `
267265
268266#### Activities
269267
270268* ` strava.activities.get(args,done) `
271269* ` strava.activities.create(args,done) `
272270* ` strava.activities.update(args,done) `
273- * ` strava.activities.listFriends(args,done) ` -> deprecated at 2.2.0
274271* ` strava.activities.listZones(args,done) `
275272* ` strava.activities.listLaps(args,done) `
276273* ` strava.activities.listComments(args,done) `
277274* ` strava.activities.listKudos(args,done) `
278- * ` strava.activities.listPhotos(args,done) ` -> deprecated at 2.2.0
279275
280276#### Clubs
281277
@@ -380,14 +376,16 @@ This update maintains feature parity with the previous implementation of `reques
380376## Development
381377
382378This package includes a full test suite runnable via ` yarn test ` .
383- It will both lint and run shallow tests on API endpoints.
379+ It will both lint and run tests on API endpoints.
384380
385381### Running the tests
386382
387- You'll first need to supply ` data/strava_config ` with an ` access_token ` that
383+ Many unit tests now use nock to mock the Strava API and can run without any real credentials.
384+ However, some integration-style tests still expect a real token and account data.
385+
386+ If you want to run the full test suite (including integration tests), you'll need to supply ` data/strava_config ` with an ` access_token ` that
388387has both private read and write permissions. Look in ` ./scripts ` for a tool
389- to help generate this token. Going forward we plan to more testing with a mocked
390- version of the Strava API so testing with real account credentials are not required.
388+ to help generate this token.
391389
392390* Make sure you've filled out all the fields in ` data/strava_config ` .
393391* Use ` strava.oauth.getRequestAccessURL({scope:"view_private,write"}) ` to generate the request url and query it via your browser.
@@ -408,15 +406,17 @@ data in the account:
408406 * Must have created at least one route
409407 * Most recent activity with an achievement should also contain a segment
410408
411- (Contributions to make the test suite more self-contained and robust by converting more tests
412- to use ` nock ` are welcome!)
409+ (Parts of the test suite already use ` nock ` to mock the API. Contributions to convert remaining integration tests to mocks are welcome.)
413410
414- * You're done! Paste the new ` access_token ` to ` data/strava_config ` and go run some tests:
411+ You're done! Paste the new ` access_token ` to ` data/strava_config ` and run the full tests:
415412
416413` yarn test ` .
417414
418415### How the tests work
419416
417+ - Tests use Mocha and Should.js.
418+ - HTTP interaction is performed with Axios; tests that mock HTTP use ` nock ` .
419+
420420Using the provided ` access_token ` tests will access each endpoint individually:
421421
422422* (For all ` GET ` endpoints) checks to ensure the correct type has been returned from the Strava.
0 commit comments