This repository was archived by the owner on Mar 10, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ const isNode = require('detect-node')
99const waterfall = require ( 'async/waterfall' )
1010const path = require ( 'path' )
1111const FactoryClient = require ( './ipfs-factory/client' )
12+ const fs = require ( 'fs' )
1213
1314describe ( '.refs' , function ( ) {
1415 this . timeout ( 80 * 1000 )
@@ -21,11 +22,21 @@ describe('.refs', function () {
2122
2223 before ( ( done ) => {
2324 fc = new FactoryClient ( )
25+ const filesPath = path . join ( __dirname , '/fixtures/test-folder' )
26+
27+ // Symlinks in a repo don't always clone well, especially on Windows.
28+ // So if the 'hello-link' is not a symlink, then make it one.
29+ const symlinkPath = filesPath + '/hello-link'
30+ const symlinkTarget = 'files/hello.txt'
31+ if ( ! fs . lstatSync ( symlinkPath ) . isSymbolicLink ( ) ) {
32+ fs . unlinkSync ( symlinkPath )
33+ fs . symlinkSync ( symlinkTarget , symlinkPath )
34+ }
35+
2436 waterfall ( [
2537 ( cb ) => fc . spawnNode ( cb ) ,
2638 ( node , cb ) => {
2739 ipfs = node
28- const filesPath = path . join ( __dirname , '/fixtures/test-folder' )
2940 ipfs . util . addFromFs ( filesPath , { recursive : true } , cb )
3041 } ,
3142 ( hashes , cb ) => {
You can’t perform that action at this time.
0 commit comments