add base test setup

This commit is contained in:
David Dias 2015-09-06 12:39:19 +01:00
parent 79589458c2
commit 9d56ac50e1
4 changed files with 46 additions and 1 deletions

View File

@ -1,7 +1,7 @@
abstract-record-store
=====================
[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io) [[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io) [![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
> A test suite and interface you can use to implement a a IPRS compliant(https://github.com/ipfs/specs/tree/master/records) Record Store.

24
package.json Normal file
View File

@ -0,0 +1,24 @@
{
"name": "abstract-record-store",
"version": "0.0.0",
"description": "A test suite and interface you can use to implement a a IPRS compliant(https://github.com/ipfs/specs/tree/master/records) Record Store",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/diasdavid/abstract-record-store.git"
},
"keywords": [
"IPFS"
],
"author": "David Dias <daviddias@ipfs.io>",
"license": "MIT",
"bugs": {
"url": "https://github.com/diasdavid/abstract-record-store/issues"
},
"homepage": "https://github.com/diasdavid/abstract-record-store",
"dependencies": {
"timed-tape": "^0.1.0"
}
}

15
tests/base-test.js Normal file
View File

@ -0,0 +1,15 @@
module.exports.all = function (test, common) {
test('Store a valid record', function (t) {
common.setup(test, function (err, recordStore) {
t.ifError(err, 'Should not throw')
t.pass('woo')
})
})
test('Store an unvalid record')
test('Store and retrieve a valid record')
test('Store a bunch of valid and unvalid records and check what gets retrieved')
test('Store a bunch of records with variable validity, wait for some to expire, check what gets retrieved')
}

6
tests/index.js Normal file
View File

@ -0,0 +1,6 @@
var timed = require('timed-tape')
module.exports = function (test, common) {
test = timed(test)
require('./base-test.js').all(test, common)
}