1
1
/* eslint-env mocha */
2
+ 'use strict'
3
+
2
4
const importer = require ( './../src' )
3
5
const BlockService = require ( 'ipfs-blocks' ) . BlockService
4
6
const DAGService = require ( 'ipfs-merkle-dag' ) . DAGService
@@ -17,9 +19,9 @@ module.exports = function (repo) {
17
19
describe ( 'layout: importer' , function ( ) {
18
20
it ( 'import a small buffer' , function ( done ) {
19
21
// this is just like "import a small file"
20
- var bs = new BlockService ( repo )
21
- var ds = new DAGService ( bs )
22
- var buf = smallBuf
22
+ const bs = new BlockService ( repo )
23
+ const ds = new DAGService ( bs )
24
+ const buf = smallBuf
23
25
importer . import ( buf , ds , function ( err , stat ) {
24
26
expect ( err ) . to . not . exist
25
27
ds . get ( stat . Hash , function ( err , node ) {
@@ -35,9 +37,9 @@ module.exports = function (repo) {
35
37
36
38
it ( 'import a big buffer' , function ( done ) {
37
39
// this is just like "import a big file"
38
- var buf = bigBuf
39
- var bs = new BlockService ( repo )
40
- var ds = new DAGService ( bs )
40
+ const buf = bigBuf
41
+ const bs = new BlockService ( repo )
42
+ const ds = new DAGService ( bs )
41
43
importer . import ( buf , ds , function ( err , stat ) {
42
44
expect ( err ) . to . not . exist
43
45
ds . get ( stat . Hash , function ( err , node ) {
@@ -61,7 +63,7 @@ module.exports = function (repo) {
61
63
expect ( err ) . to . not . exist
62
64
const leaf = new DAGNode ( )
63
65
64
- var marbuf2 = bigLink
66
+ const marbuf2 = bigLink
65
67
leaf . unMarshal ( marbuf2 )
66
68
expect ( node . links ) . to . deep . equal ( leaf . links )
67
69
expect ( node . links . length ) . to . equal ( 0 )
0 commit comments