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

Commit 371efda

Browse files
committed
Merge pull request #62 from xicombd/use-buffer-loader
Use buffer-loader for tests
2 parents 096bfae + b971337 commit 371efda

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
"homepage": "https://github.com/ipfs/js-ipfs#readme",
3636
"devDependencies": {
3737
"async": "^1.5.2",
38-
"binary-loader": "0.0.1",
3938
"brfs": "^1.4.3",
39+
"buffer-loader": "0.0.1",
4040
"chai": "^3.4.1",
4141
"fs-blob-store": "^5.2.1",
4242
"idb-plus-blob-store": "^1.0.0",
@@ -55,7 +55,6 @@
5555
"ncp": "^2.0.0",
5656
"nexpect": "^0.5.0",
5757
"pre-commit": "^1.1.2",
58-
"raw-loader": "^0.5.1",
5958
"rimraf": "^2.4.4",
6059
"standard": "^5.4.1",
6160
"transform-loader": "^0.2.3",

tests/test-core/browser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const async = require('async')
44
const store = require('idb-plus-blob-store')
55
const _ = require('lodash')
66

7-
const repoContext = require.context('raw!./../repo-example', true)
7+
const repoContext = require.context('buffer!./../repo-example', true)
88

99
const idb = window.indexedDB ||
1010
window.mozIndexedDB ||

tests/test-core/test-block.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,19 @@ const isNode = !global.window
1212

1313
const fileA = isNode
1414
? fs.readFileSync(process.cwd() + '/tests/repo-example/blocks/12207028/122070286b9afa6620a66f715c7020d68af3d10e1a497971629c07606bfdb812303d.data')
15-
: new Buffer(require('binary!./../repo-example/blocks/12207028/122070286b9afa6620a66f715c7020d68af3d10e1a497971629c07606bfdb812303d.data'), 'binary')
15+
: require('buffer!./../repo-example/blocks/12207028/122070286b9afa6620a66f715c7020d68af3d10e1a497971629c07606bfdb812303d.data')
1616

17-
// console.log('=>', fileA)
18-
// console.log('=>', fileA.length)
19-
20-
describe('block', () => {
17+
// TODO use arrow funtions again when https://github.com/webpack/webpack/issues/1944 is fixed
18+
describe('block', function () {
2119
var ipfs
2220

23-
it('get', done => {
21+
it('get', function (done) {
2422
ipfs = new IPFS()
2523
const b58mh = 'QmVtU7ths96fMgZ8YSZAbKghyieq7AjxNdcqyVzxTt3qVe'
2624
const mh = new Buffer(base58.decode(b58mh))
2725
ipfs.block.get(mh, (err, block) => {
2826
expect(err).to.not.exist
2927
const eq = fileA.equals(block.data)
30-
console.log(block)
3128
expect(eq).to.equal(true)
3229
done()
3330
})
@@ -62,7 +59,7 @@ describe('block', () => {
6259
})
6360
})
6461

65-
it('stat', done => {
62+
it('stat', function (done) {
6663
const mh = new Buffer(base58
6764
.decode('QmVtU7ths96fMgZ8YSZAbKghyieq7AjxNdcqyVzxTt3qVe'))
6865
ipfs.block.stat(mh, (err, stats) => {

0 commit comments

Comments
 (0)