Browse Source

#8 add test case for lstat and stat

Ben Hsieh 8 years ago
parent
commit
e39d252873
1 changed files with 16 additions and 1 deletions
  1. 16
    1
      test/test-fs.js

+ 16
- 1
test/test-fs.js View File

@@ -396,12 +396,27 @@ describe('stat and lstat test', (report, done) => {
396 396
     return fs.stat(file)
397 397
   })
398 398
   .then((stat) => {
399
-    console.log(stat)
400 399
     report(
401 400
       <Assert key="should have properties"
402 401
         expect={['size', 'type', 'lastModified', 'filename', 'path']}
403 402
         comparer={Comparer.hasProperties}
404 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 420
     done()
406 421
   })
407 422