Socket
Socket
Sign inDemoInstall

@advanced-rest-client/arc-data-generator

Package Overview
Dependencies
82
Maintainers
4
Versions
28
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @advanced-rest-client/arc-data-generator

Generates data for ARC demo pages and tests


Version published
Weekly downloads
25
increased by212.5%
Maintainers
4
Install size
13.5 MB
Created
Weekly downloads
 

Readme

Source

ArcMock

Generates data for ARC demo pages and tests scenarios.

Published on NPM

tests

Note API surface changed in version 4.x.

Usage

Installation

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

In a test scenario

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

describe('Action', () => {
  before(async () => {
    const generator = new ArcMock();
    await generator.store.insertSavedIfNotExists();
  });

  it('has request data', () => {
    // ...
  });
});

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.

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

const mock = new ArcMock({ store: PouchDB });
// 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

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

Running the tests

npm test

Keywords

FAQs

Last updated on 19 Aug 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc