Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md feat: add snapshot download script Jun 26, 2019
api-data-script.js feat: initial commit Jun 26, 2019
download-api-snapshot.js feat: add snapshot download script Jun 26, 2019
index.js feat: initial commit Jun 26, 2019
package.json feat: add snapshot download script Jun 26, 2019

README.md

Test tools

API data script

Tests a snapshot of database operations against an API data connector, using Mocha.

Usage

const { apiDataScript } = require('@dadi/test-tools')
const MyDataConnector = require('/path/to/your/data-connector')

describe.only(
  'Data script',
  apiDataScript({
    // The constructor for the data connector being tested.
    Connector: MyDataConnector,

    // The contents of the data script.
    script: fs.readFileSync('/path/to/your/data-snapshot', 'utf8'),

    // The interval (in milliseconds) between each test. Defaults to 5.
    testDelay: 5
  })
)

To pull the latest snapshot from the API repo, run:

npm run download-api-snapshot -- /target/directory

This will download data.apisnapshot and save it on /target/directory.

You can’t perform that action at this time.