This repository has been archived by the owner on Feb 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from eugene-manuilov/release/1.1.0
Release/1.1.0
- Loading branch information
Showing
7 changed files
with
265 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Change Log | ||
|
||
## v1.1.0 (2017-06-19) | ||
|
||
**Implemented enhancements:** | ||
|
||
- createActions and createRequests functions: `namespace` argument has been replaced with `args` to allow support multiple options, `namespace` argument becomes a part of `args` object. | ||
- createActions: added ability to skip some fetch functions generation. | ||
- createRequests: added ability to skip some request functions generation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { createRequests } from '../lib/index'; | ||
|
||
test('Check requests created by createRequests function', () => { | ||
const requests = createRequests('http://wordpress.test/wp-json/', ['books', 'authors']); | ||
|
||
expect(typeof requests.requestBooks).toBe('function'); | ||
expect(typeof requests.requestBooksEndpoint).toBe('function'); | ||
expect(typeof requests.requestBooksById).toBe('function'); | ||
expect(typeof requests.requestBooksEndpointById).toBe('function'); | ||
expect(typeof requests.requestAllBooks).toBe('function'); | ||
expect(typeof requests.requestAllBooksEndpoint).toBe('function'); | ||
expect(typeof requests.requestAllBooksEndpointById).toBe('function'); | ||
|
||
expect(typeof requests.requestAuthors).toBe('function'); | ||
expect(typeof requests.requestAuthorsEndpoint).toBe('function'); | ||
expect(typeof requests.requestAuthorsById).toBe('function'); | ||
expect(typeof requests.requestAuthorsEndpointById).toBe('function'); | ||
expect(typeof requests.requestAllAuthors).toBe('function'); | ||
expect(typeof requests.requestAllAuthorsEndpoint).toBe('function'); | ||
expect(typeof requests.requestAllAuthorsEndpointById).toBe('function'); | ||
}); | ||
|
||
test('Check ability to skip some requests', () => { | ||
const requests = createRequests('http://wordpress.test/wp-json/', ['books'], { | ||
request: false, | ||
requestEndpoint: false, | ||
requestById: false, | ||
requestEndpointById: false, | ||
requestAll: false, | ||
requestAllEndpoint: false, | ||
requestAllEndpointById: false, | ||
}); | ||
|
||
expect(typeof requests.requestBooks).toBe('undefined'); | ||
expect(typeof requests.requestBooksEndpoint).toBe('undefined'); | ||
expect(typeof requests.requestBooksById).toBe('undefined'); | ||
expect(typeof requests.requestBooksEndpointById).toBe('undefined'); | ||
expect(typeof requests.requestAllBooks).toBe('undefined'); | ||
expect(typeof requests.requestAllBooksEndpoint).toBe('undefined'); | ||
expect(typeof requests.requestAllBooksEndpointById).toBe('undefined'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.