Sfoglia il codice sorgente

Merge pull request #237 from overleaf/jpa-fix-unit-tests

[misc] fix unit tests following the merge of atomic writes
Jakob Ackermann 5 anni fa
parent
commit
31a29403a1
1 ha cambiato i file con 7 aggiunte e 1 eliminazioni
  1. 7 1
      services/clsi/test/unit/js/ContentCacheManagerTests.js

+ 7 - 1
services/clsi/test/unit/js/ContentCacheManagerTests.js

@@ -79,7 +79,13 @@ describe('ContentCacheManager', function () {
             throw new Error()
           }
         },
-        rename: sinon.stub().resolves(),
+        async rename(oldName, newName) {
+          if (!files[oldName]) {
+            throw new Error()
+          }
+          files[newName] = files[oldName]
+          delete files[oldName]
+        },
         unlink: sinon.stub().resolves()
       }
     }