micro-analytics-cli
micro-analytics-cli copied to clipboard
Database adapter test suite?
Should we have a test suite new database adapter can run against to check compatibility with the spec? Currently writing docs for it, I feel like that'd make it much easier.
This might require having a repo setup with the tests and a bunch of other niceties (e.g. linting) which developers can simply clone to write a new adapter.
I think it would be really awesome if we could do something like the following.
import { adapterTestSuite } from 'micro-analytics' // or some other package that is published from this repo
import adapter from './index'
adapterTestSuite({
adapter,
beforeAll: () => { },
afterAll: () => {},
before: () => {},
after: () => {},
})
This would make it much easier for adapters to test against new versions.
That's a really good idea! We could just let our tests run through with a passed in adapter?! That would also test atomicity and stuff. (#20)