[wp-trac] [WordPress Trac] #40734: REST API: Tests: Prohibit errors when generating wp-api.js fixtures
WordPress Trac
noreply at wordpress.org
Thu May 11 16:56:49 UTC 2017
#40734: REST API: Tests: Prohibit errors when generating wp-api.js fixtures
------------------------------+----------------------------
Reporter: jnylen0 | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: Build/Test Tools | Version:
Severity: normal | Keywords: has-patch
Focuses: rest-api |
------------------------------+----------------------------
In #39264 we added tests for `wp-api.js` to core, including a `wp-api-
generated.js` fixture file that is automatically generated from API
requests during test suite runs.
While reviewing #40450 I found that some of these requests are erroring,
so we are storing error responses in the fixture data. For example:
- https://core.trac.wordpress.org/browser/tags/4.7.4/tests/qunit/fixtures
/wp-api-generated.js#L3394
- https://core.trac.wordpress.org/browser/tags/4.7.4/tests/qunit/fixtures
/wp-api-generated.js#L3567
I fixed this by requiring a `200` status code for these requests (they are
all `GET` requests) and updating everything to send the right kind of
data. I also needed to update the `$fixture_replacements` array which
replaces dynamic data with static values - instructions for doing so are
at comment:29:ticket:39264.
Note, the patch attached to this ticket needs to be applied '''after'''
#40450.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40734>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list