1.9.5 • Published 4 months ago

@keyv/test-suite v1.9.5

Weekly downloads
49
License
MIT
Repository
github
Last release
4 months ago

@keyv/test-suite

Test suite for Keyv API compliance

build codecov npm 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"
}

Example for Storage Adapters

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

Testing Compression Adapters

If you're testing a compression adapter, you can use the keyvCompresstionTests method instead of keyvTestSuite.

const {keyvCompresstionTests} = require('@keyv/test-suite');
const KeyvGzip = require('@keyv/compress-gzip');

keyvCompresstionTests(test, new KeyvGzip());

License

MIT © Jared Wray

1.9.5

4 months ago

1.9.4

7 months ago

1.9.3

8 months ago

1.9.1

1 year ago

1.9.2

1 year ago

1.9.0

1 year ago

1.8.9

1 year ago

1.8.8

1 year ago

1.8.7

1 year ago

1.8.6

2 years ago

1.7.6

2 years ago

1.7.5

2 years ago

1.7.4

2 years ago

1.7.3

2 years ago

1.7.2

2 years ago

1.7.1

2 years ago

1.7.0

2 years ago

1.6.13

2 years ago

1.6.15

2 years ago

1.6.14

2 years ago

1.6.12

2 years ago

1.6.11

6 years ago

1.6.10

7 years ago

1.6.9

7 years ago

1.6.8

7 years ago

1.6.7

7 years ago

1.6.6

7 years ago

1.6.5

7 years ago

1.6.4

7 years ago

1.6.3

7 years ago

1.6.2

7 years ago

1.6.1

7 years ago

1.6.0

7 years ago

1.5.2

7 years ago

1.5.1

7 years ago