Skip to content

Conversation

@kadamwhite
Copy link
Collaborator

The fact that 403's are returned for some requests and 401's for others is a result of https://core.trac.wordpress.org/ticket/35527

This adds documentation and an integration test around a full post create-update-delete cycle

Using a variable makes it less likely that errors will be introduced
by mis-typing "success"; variable naming can be checked via JSHint.
These methods only take a callback as a function; specifying properties
on that function is irrelevant from the client's point of view.
Without being able to pass a data object, all that .delete can do
for a post object is to trash it: without passing a data object
other resources, such as users, cannot be deleted at all (there is
no such thing as a trashed user, so `force: true` MUST be passed in
order to trigger a user record deletion)
It was inconsistent that authentication could be specified as key-value
pairs when creating the WP instance, but not when calling the .auth()
method on a WPRequest chain. This alters WPRequest's .auth() method to
take EITHER the previously-supported two-string-arguments for username
and password, OR an object with 'username' and 'password' strig properties.
…osts

This was a frequent ask in the github issues; this should fix #112

This is also baby-steps towards fully closing out #91
Due to [completely inexplicable "design" choices in NPM](npm/npm#3059),
"prepublish" is _always_ run after `npm install`. This means that
we _cannot_ run our entire test suite in prepublish, or else Travis
(which `npm install`'s on each run) will (a) superfluously run
the test suite twice, and (b) run the integration test suite (which
is important to run before publish, but cannot be run in travis as
there is no VM set up to field the requests). Removing the prepublish
hook fixes the issue, though it does mean that we need to explicitly
run all tests before publishing ('prepublish' used to be a safeguard).

Additional changes:

- Travis should test recent stable node versions, as well as iojs
- Travis should also run ONLY the unit tests
- Travis should use the "list" mocha reporter: "nyan" is adorable
  but really makes travis output illegible
- `npm test` locally should run ALL tests, including integration suite
@kadamwhite kadamwhite force-pushed the create-update-examples branch from 0bce2c9 to 79be869 Compare January 19, 2016 17:58
@kadamwhite kadamwhite merged commit 79be869 into master Jan 19, 2016
@kadamwhite kadamwhite deleted the create-update-examples branch January 19, 2016 18:02
@kadamwhite kadamwhite mentioned this pull request Jan 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants