-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: adds readme to test-helper package
- Loading branch information
1 parent
baf65b8
commit 5653e73
Showing
2 changed files
with
37 additions
and
11 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,37 @@ | ||
# APIMatic Test Helper Libary for JavaScript | ||
|
||
> This library is currently in preview. | ||
Provides assertion utilities for testing api calls. It can be plugged in as dev dependency to any library. | ||
|
||
The exported helper functions include: | ||
|
||
1. **getStreamData**: Get streaming data from a given URL. | ||
2. **areStreamsMatching**: Check if input matches the contents of a file by comparing stream data or Blob data. | ||
3. **expectHeadersToMatch**: Compare actual headers with expected headers, ignoring case sensitivity. | ||
4. **isProperSubsetOf**: Recursively check whether the left object or array is a proper subset of the right object or array. | ||
5. **isOrderedSupersetOf**: Check if one ordered array is a superset of another ordered array. | ||
6. **isSuperSetOf**: Check if one array is a superset of another array. | ||
|
||
This library is used as a dev-dependency by JavaScript SDKs generated by the [APIMatic Code Generator](http://www.apimatic.io). | ||
|
||
## Builds | ||
|
||
The following environments are supported: | ||
|
||
1. Node.js v10+ | ||
1. Bundlers like Rollup or Webpack | ||
1. Web browsers | ||
|
||
To support multiple environments, we export various builds: | ||
|
||
| Environment | Usage | | ||
| --- | --- | | ||
| Common.js | Import like this: `require('@apimatic/test-helper')`. | | ||
| ES Module | Import like this: `import { /* your imports */ } from '@apimatic/test-helper'`. | | ||
| Browsers | *Use script: `https://unpkg.com/@apimatic/test-helper@VERSION/umd/schema.js` | | ||
| Modern Browsers (supports ESM and uses modern JS) | *Use script: `https://unpkg.com/@apimatic/test-helper@VERSION/umd/schema.esm.js` | | ||
|
||
_* Don't forget to replace VERSION with the version number._ | ||
|
||
**Note**: We discourage importing files or modules directly from the package. These are likely to change in the future and should not be considered stable. |