From 5653e7392383fbf1c9926c65a02bf063ef6ae636 Mon Sep 17 00:00:00 2001 From: Asad Ali Date: Thu, 18 Jul 2024 13:41:56 +0500 Subject: [PATCH] docs: adds readme to test-helper package --- packages/test-helper/CHANGELOG.md | 11 --------- packages/test-helper/README.md | 37 +++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 11 deletions(-) delete mode 100644 packages/test-helper/CHANGELOG.md create mode 100644 packages/test-helper/README.md diff --git a/packages/test-helper/CHANGELOG.md b/packages/test-helper/CHANGELOG.md deleted file mode 100644 index a67b6ef..0000000 --- a/packages/test-helper/CHANGELOG.md +++ /dev/null @@ -1,11 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -### 0.1.2 (2024-07-11) - -### Features - -- **test-helper:** add test-helper in runtime libraries repo - diff --git a/packages/test-helper/README.md b/packages/test-helper/README.md new file mode 100644 index 0000000..121a81c --- /dev/null +++ b/packages/test-helper/README.md @@ -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. \ No newline at end of file