micro-analytics / micro-analytics-cli

Public analytics as a Node.js microservice. No sysadmin experience required! 📈
MIT License
734 stars 39 forks source link

Database adapter test suite? #19

Open mxstbr opened 7 years ago

mxstbr commented 7 years ago

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.

relekang commented 7 years ago

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.

mxstbr commented 7 years ago

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)