This repository was archived by the owner on Mar 10, 2020. It is now read-only.
File tree 1 file changed +12
-1
lines changed
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')
9
9
const waterfall = require ( 'async/waterfall' )
10
10
const path = require ( 'path' )
11
11
const FactoryClient = require ( './ipfs-factory/client' )
12
+ const fs = require ( 'fs' )
12
13
13
14
describe ( '.refs' , function ( ) {
14
15
this . timeout ( 80 * 1000 )
@@ -21,11 +22,21 @@ describe('.refs', function () {
21
22
22
23
before ( ( done ) => {
23
24
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
+
24
36
waterfall ( [
25
37
( cb ) => fc . spawnNode ( cb ) ,
26
38
( node , cb ) => {
27
39
ipfs = node
28
- const filesPath = path . join ( __dirname , '/fixtures/test-folder' )
29
40
ipfs . util . addFromFs ( filesPath , { recursive : true } , cb )
30
41
} ,
31
42
( hashes , cb ) => {
You can’t perform that action at this time.
0 commit comments