Browse Source

unlink test completed

ameba23 3 years ago
parent
commit
1743a2fca6
1 changed files with 4 additions and 3 deletions
  1. 4
    3
      test/index.test.js

+ 4
- 3
test/index.test.js View File

@@ -246,16 +246,17 @@ describe('mount', (context) => {
246 246
       run(`ls ${storage.blue}`, (err, output) => {
247 247
         assert.error(err, 'no error on ls')
248 248
         assert.true(output[0].split('\n').indexOf('hello.txt') > -1, 'file successfully replicated')
249
-        run(`rm -f ${storage.blue}/hello.txt`, (err, output) => {
249
+        run(`unlink ${storage.blue}/hello.txt`, (err, output) => {
250
+        // fs.unlink(path.join(storage.blue, 'hello.txt'), (err) => {
250 251
           assert.error(err, 'no error on rm file')
251 252
           run(`cat ${storage.blue}/hello.txt`, (err, output) => {
252 253
             assert.ok(err, 'error on cat out file')
253
-            console.log(output)
254
+            assert.notOk(output, 'cat returns no output')
254 255
             replicate(orangeDrive, blueDrive, (err) => {
255 256
               assert.error(err, 'no error on replicate')
256 257
               run(`ls ${storage.orange}`, (err, output) => {
257 258
                 assert.error(err, 'no error')
258
-                assert.same(output, [''], 'ls returns')
259
+                assert.ok(output.indexOf('hello.txt\n') < 0, 'ls does not find the file')
259 260
                 cleanup(destroy.orange, storage.orange).then(() => {
260 261
                   cleanup(destroy.blue, storage.blue).then(next)
261 262
                 })