Minor spacing adjustments, updated readme, added comments
This commit is contained in:
parent
37f1284ccb
commit
a271c4a04b
|
@ -73,7 +73,7 @@ jest --group=api
|
|||
|
||||
### Test groups
|
||||
|
||||
This package makes use of the `jest-runner-groups` package, which allows grouping tests together around semantic groups (such as `orders` API calls, or `coupon` API calls) to make running test suites more granular.
|
||||
This package makes use of the `jest-runner-groups` package, which allows grouping tests together around semantic groups (such as `orders` API calls, or `coupons` API calls) to make running test suites more granular.
|
||||
|
||||
Before the `describe()` statement, add in a doc block containing the desired groups:
|
||||
|
||||
|
@ -117,7 +117,7 @@ You can make use of the REST API log plugin to see how requests are being made,
|
|||
|
||||
## Generate a Postman Collection
|
||||
|
||||
This package also allows generating a `collection.json` file that can be imported into Postman and other REST clients that support the Postman v2 collection. To generate this file, run:
|
||||
This package also allows generating a `collection.json` file using the test data in this package. This file can be imported into Postman and other REST clients that support the Postman v2 collection. To generate this file, run:
|
||||
|
||||
```
|
||||
npm run make:collection
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
/**
|
||||
* Customer billing object.
|
||||
*
|
||||
* Used in the following APIs:
|
||||
* https://woocommerce.github.io/woocommerce-rest-api-docs/#customers
|
||||
* https://woocommerce.github.io/woocommerce-rest-api-docs/#orders
|
||||
*
|
||||
*/
|
||||
const customerBilling = {
|
||||
first_name: 'John',
|
||||
last_name: 'Doe',
|
||||
|
@ -12,6 +20,13 @@ const customerBilling = {
|
|||
email: 'john.doe@example.com',
|
||||
}
|
||||
|
||||
/**
|
||||
* Customer shipping object.
|
||||
*
|
||||
* Used in the following APIs:
|
||||
* https://woocommerce.github.io/woocommerce-rest-api-docs/#customers
|
||||
* https://woocommerce.github.io/woocommerce-rest-api-docs/#orders
|
||||
*/
|
||||
const customerShipping = {
|
||||
first_name: 'Tim',
|
||||
last_name: 'Clark',
|
||||
|
|
|
@ -10,12 +10,12 @@ describe('Test API connectivity', () => {
|
|||
|
||||
it('can access a non-authenticated endpoint', async () => {
|
||||
const result = await getRequest( '' );
|
||||
expect(result.statusCode).toEqual(200);
|
||||
expect( result.statusCode ).toEqual( 200 );
|
||||
});
|
||||
|
||||
it('can access an authenticated endpoint', async () => {
|
||||
const result = await getRequest( 'system_status' );
|
||||
expect(result.statusCode).toEqual(200);
|
||||
expect( result.statusCode ).toEqual( 200 );
|
||||
});
|
||||
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue