Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

Commit

Permalink
refactor: removing IDB data storing
Browse files Browse the repository at this point in the history
Signed-off-by: Pawel Psztyc <[email protected]>
  • Loading branch information
jarrodek committed Oct 18, 2021
1 parent 305ac80 commit a868d35
Show file tree
Hide file tree
Showing 35 changed files with 1,452 additions and 5,222 deletions.
34 changes: 6 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

Generates data for ARC demo pages and tests scenarios.

[![Published on NPM](https://img.shields.io/npm/v/@advanced-rest-client/arc-data-generator.svg)](https://www.npmjs.com/package/@advanced-rest-client/arc-data-generator)
[![Published on NPM](https://img.shields.io/npm/v/@advanced-rest-client/arc-mock.svg)](https://www.npmjs.com/package/@advanced-rest-client/arc-mock)

[![tests](https://github.com/advanced-rest-client/arc-data-generator/actions/workflows/deployment.yml/badge.svg)](https://github.com/advanced-rest-client/arc-data-generator/actions/workflows/deployment.yml)
[![tests](https://github.com/advanced-rest-client/arc-mock/actions/workflows/deployment.yml/badge.svg)](https://github.com/advanced-rest-client/arc-mock/actions/workflows/deployment.yml)

**Note** API surface changed in version 4.x.

Expand All @@ -13,14 +13,14 @@ Generates data for ARC demo pages and tests scenarios.
### Installation

```sh
npm install --save @advanced-rest-client/arc-data-generator
npm install --save @advanced-rest-client/arc-mock
```

### In a test scenario

```js
import { assert } from '@open-wc/testing';
import { ArcMock } from '@advanced-rest-client/arc-data-generator';
import { ArcMock } from '@advanced-rest-client/arc-mock';

describe('Action', () => {
before(async () => {
Expand All @@ -34,33 +34,11 @@ describe('Action', () => {
});
```

### Using the `store` namespace

The `store` namespace (or the `Store` class) requires a reference to the PouchDB database. Because PouchDB has a legacy architecture, NodeJS and a browser imports the code differently. This means that your test scenario has to import PouchDB and set the reference to the PouchDB class in the init options.

```javascript
// in NodeJS
import PouchDB from 'pouchdb';
import { ArcMock } from '@advanced-rest-client/arc-data-generator';

const mock = new ArcMock({ store: PouchDB });
```

```javascript
// in a browser
import 'pouchdb/dist/pouchdb.js';
import { ArcMock } from '@advanced-rest-client/arc-data-generator';

/* global PouchDB */

const mock = new ArcMock({ store: PouchDB });
```

## Development

```sh
git clone https://github.com/advanced-rest-client/arc-data-generator
cd arc-data-generator
git clone https://github.com/advanced-rest-client/arc-mock
cd arc-mock
npm install
```

Expand Down
1 change: 0 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ export { Certificates } from './src/lib/Certificates';
export { Urls } from './src/lib/Urls';
export { Authorization } from './src/lib/Authorization';
export { RestApi } from './src/lib/RestApi';
export { Store } from './src/lib/Store';
export { ArcMock } from './src/ArcMock';
export * from './types';
1 change: 0 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ export { Certificates } from './src/lib/Certificates.js';
export { Urls } from './src/lib/Urls.js';
export { Authorization } from './src/lib/Authorization.js';
export { RestApi } from './src/lib/RestApi.js';
export { Store } from './src/lib/Store.js';
export { ArcMock } from './src/ArcMock.js';
Loading

0 comments on commit a868d35

Please sign in to comment.