micro-analytics-cli icon indicating copy to clipboard operation
micro-analytics-cli copied to clipboard

Database adapter test suite?

Open mxstbr opened this issue 8 years ago • 2 comments

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.

mxstbr avatar Jan 13 '17 10:01 mxstbr

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.

relekang avatar Jan 13 '17 11:01 relekang

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)

mxstbr avatar Jan 13 '17 12:01 mxstbr