ソースを参照

Add test case for #254, IOS file latestModifed date overflow issue

Ben Hsieh 8 年 前
コミット
71d6fb4dbc
共有1 個のファイルを変更した14 個の追加0 個の削除を含む
  1. 14
    0
      test/test-0.10.3.js

+ 14
- 0
test/test-0.10.3.js ファイルの表示

@@ -75,3 +75,17 @@ describe('#230 #249 cookies manipulation', (report, done) => {
75 75
   })
76 76
 
77 77
 })
78
+
79
+describe('#254 IOS fs.stat lastModified date correction', (report, done) => {
80
+
81
+  let path = dirs.DocumentDir + '/temp' + Date.now()
82
+  fs.createFile(path, 'hello', 'utf8' )
83
+    .then(() => fs.stat(path))
84
+    .then((stat) => {
85
+      console.log(stat)
86
+      let p = stat.lastModified / Date.now()
87
+      report(<Assert key="date is correct" expect={true} actual={ p< 1.05 && p > 0.95}/>)
88
+      done()
89
+    })
90
+
91
+})