From 9d56ac50e15a14fd805b6387654f7d85bfb987fd Mon Sep 17 00:00:00 2001 From: David Dias Date: Sun, 6 Sep 2015 12:39:19 +0100 Subject: [PATCH] add base test setup --- README.md | 2 +- package.json | 24 ++++++++++++++++++++++++ tests/base-test.js | 15 +++++++++++++++ tests/index.js | 6 ++++++ 4 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 package.json create mode 100644 tests/base-test.js create mode 100644 tests/index.js diff --git a/README.md b/README.md index 78fef94..c2cb169 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/package.json b/package.json new file mode 100644 index 0000000..8f8e331 --- /dev/null +++ b/package.json @@ -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 ", + "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" + } +} diff --git a/tests/base-test.js b/tests/base-test.js new file mode 100644 index 0000000..49ea253 --- /dev/null +++ b/tests/base-test.js @@ -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') + +} diff --git a/tests/index.js b/tests/index.js new file mode 100644 index 0000000..b232406 --- /dev/null +++ b/tests/index.js @@ -0,0 +1,6 @@ +var timed = require('timed-tape') + +module.exports = function (test, common) { + test = timed(test) + require('./base-test.js').all(test, common) +}