@keyv/test-suite

    1.7.3 • Public • Published

    @keyv/test-suite keyv

    Test suite for Keyv API compliance

    build codecov npm

    Complete AVA test suite to test a Keyv storage adapter for API compliance.

    Usage

    Install

    Install AVA, Keyv and @keyv/test-suite as development dependencies.

    npm install --save-dev ava keyv @keyv/test-suite

    Then update keyv and @keyv/test-suite versions to * in package.json to ensure you're always testing against the latest version.

    Create Test File

    test.js

    import test from 'ava';
    import keyvTestSuite from '@keyv/test-suite';
    import Keyv from 'keyv';
    import KeyvStore from './';
    
    const store = () => new KeyvStore();
    keyvTestSuite(test, Keyv, store);

    Where KeyvStore is your storage adapter.

    Set your test script in package.json to ava.

    "scripts": {
      "test": "ava"
    }

    Test on Active Node.js LTS and Higher

    An example configuration for Travis CI would look like this:

    .travis.yml

    language: node_js
    node_js:
      - '8'
      - '6'
      - '4'
    script: npm test

    Example

    Take a look at keyv-redis for an example of an existing storage adapter using @keyv/test-suite.

    License

    MIT © Jared Wray & Luke Childs

    Install

    npm i @keyv/test-suite

    DownloadsWeekly Downloads

    17

    Version

    1.7.3

    License

    MIT

    Unpacked Size

    79.8 kB

    Total Files

    21

    Last publish

    Collaborators

    • jaredwray
    • lukechilds