Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
Use regular functions on tests that use Buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
fbaiodias committed Jan 28, 2016
1 parent 2a2699f commit b971337
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions tests/test-core/test-block.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,15 @@ const Block = require('ipfs-merkle-dag').Block

const isNode = !global.window

// FIXME remove this (it is only here because otherwise webpack is not loading Buffer and it is needed to the tests bellow)
const noop = new Buffer([]) // eslint-disable-line

const fileA = isNode
? fs.readFileSync(process.cwd() + '/tests/repo-example/blocks/12207028/122070286b9afa6620a66f715c7020d68af3d10e1a497971629c07606bfdb812303d.data')
: require('buffer!./../repo-example/blocks/12207028/122070286b9afa6620a66f715c7020d68af3d10e1a497971629c07606bfdb812303d.data')

// console.log('=>', fileA)
// console.log('=>', fileA.length)

describe('block', () => {
// TODO use arrow funtions again when https://github.com/webpack/webpack/issues/1944 is fixed
describe('block', function () {
var ipfs

it('get', done => {
it('get', function (done) {
ipfs = new IPFS()
const b58mh = 'QmVtU7ths96fMgZ8YSZAbKghyieq7AjxNdcqyVzxTt3qVe'
const mh = new Buffer(base58.decode(b58mh))
Expand Down Expand Up @@ -64,7 +59,7 @@ describe('block', () => {
})
})

it('stat', done => {
it('stat', function (done) {
const mh = new Buffer(base58
.decode('QmVtU7ths96fMgZ8YSZAbKghyieq7AjxNdcqyVzxTt3qVe'))
ipfs.block.stat(mh, (err, stats) => {
Expand Down

0 comments on commit b971337

Please sign in to comment.