Przeglądaj źródła

#8 add test case for lstat and stat

Ben Hsieh 9 lat temu
rodzic
commit
e39d252873
1 zmienionych plików z 16 dodań i 1 usunięć
  1. 16
    1
      test/test-fs.js

+ 16
- 1
test/test-fs.js Wyświetl plik

396
     return fs.stat(file)
396
     return fs.stat(file)
397
   })
397
   })
398
   .then((stat) => {
398
   .then((stat) => {
399
-    console.log(stat)
400
     report(
399
     report(
401
       <Assert key="should have properties"
400
       <Assert key="should have properties"
402
         expect={['size', 'type', 'lastModified', 'filename', 'path']}
401
         expect={['size', 'type', 'lastModified', 'filename', 'path']}
403
         comparer={Comparer.hasProperties}
402
         comparer={Comparer.hasProperties}
404
         actual={stat}/>)
403
         actual={stat}/>)
404
+    return fs.stat('13123132')
405
+  })
406
+  .then(()=>{})
407
+  .catch((err) => {
408
+    console.log(err)
409
+    report(<Assert key="stat error catacable"
410
+      expect={true}
411
+      actual={true}/>)
412
+    done()
413
+  })
414
+  .then(()=>{})
415
+  .catch((err) => {
416
+    console.log(err)
417
+    report(<Assert key="lstat error catacable"
418
+      expect={true}
419
+      actual={true}/>)
405
     done()
420
     done()
406
   })
421
   })
407
 
422