ipfs-repo
Advanced tools
Comparing version
{ | ||
"name": "ipfs-repo", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "IPFS Repo implementation", | ||
@@ -29,2 +29,3 @@ "main": "src/index.js", | ||
"bs58": "^3.0.0", | ||
"buffer-loader": "^0.0.1", | ||
"chai": "^3.4.1", | ||
@@ -46,3 +47,2 @@ "fs-blob-store": "^5.2.1", | ||
"pre-commit": "^1.1.1", | ||
"raw-loader": "^0.5.1", | ||
"rimraf": "^2.4.4", | ||
@@ -49,0 +49,0 @@ "standard": "^5.1.1", |
@@ -9,3 +9,3 @@ /* globals describe, before */ | ||
const repoContext = require.context('raw!./test-repo', true) | ||
const repoContext = require.context('buffer!./test-repo', true) | ||
@@ -20,2 +20,3 @@ const idb = window.indexedDB || | ||
// TODO use arrow funtions again when https://github.com/webpack/webpack/issues/1944 is fixed | ||
describe('IPFS Repo Tests on the Browser', function () { | ||
@@ -22,0 +23,0 @@ before(function (done) { |
@@ -12,6 +12,6 @@ /* globals describe, it*/ | ||
? fs.readFileSync(process.cwd() + '/tests/test-repo/blocks/12207028/122070286b9afa6620a66f715c7020d68af3d10e1a497971629c07606bfdb812303d.data') | ||
: new Buffer(require('raw!./test-repo/blocks/12207028/122070286b9afa6620a66f715c7020d68af3d10e1a497971629c07606bfdb812303d.data')) | ||
: require('buffer!./test-repo/blocks/12207028/122070286b9afa6620a66f715c7020d68af3d10e1a497971629c07606bfdb812303d.data') | ||
module.exports = function (repo) { | ||
describe('IPFS Repo Tests', () => { | ||
describe('IPFS Repo Tests', function () { | ||
it('check if Repo exists', done => { | ||
@@ -109,6 +109,6 @@ repo.exists((err, exists) => { | ||
describe('datastore', () => { | ||
describe('datastore', function () { | ||
const baseFileHash = 'QmVtU7ths96fMgZ8YSZAbKghyieq7AjxNdcqyVzxTt3qVe' | ||
it('reads block', done => { | ||
it('reads block', function (done) { | ||
const buf = new Buffer(base58.decode(baseFileHash)) | ||
@@ -123,3 +123,3 @@ repo.datastore.createReadStream(buf) | ||
it('write a block', done => { | ||
it('write a block', function (done) { | ||
const rnd = 'QmVtU7ths96fMgZ8YSZAbKghyieq7AjxNdcqyVtesthash' | ||
@@ -136,3 +136,3 @@ const mh = new Buffer(base58.decode(rnd)) | ||
it('block exists', done => { | ||
it('block exists', function (done) { | ||
const buf = new Buffer(base58.decode(baseFileHash)) | ||
@@ -147,3 +147,3 @@ | ||
it('check for non existent block', done => { | ||
it('check for non existent block', function (done) { | ||
const buf = new Buffer('random buffer') | ||
@@ -158,3 +158,3 @@ | ||
it('remove a block', done => { | ||
it('remove a block', function (done) { | ||
const buf = new Buffer(base58.decode(baseFileHash)) | ||
@@ -161,0 +161,0 @@ repo.datastore.remove(buf, (err) => { |
111976
0.13%509
0.2%