Skip to content

Commit 6d7b5dc

Browse files
authored
Merge pull request #1349 from remotestorage/bugfix/dropbox_suite
Improve Dropbox suite, fix interval clearance
2 parents b9d8e6d + 1aa9e9f commit 6d7b5dc

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

test/unit/dropbox.test.mjs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ describe('Dropbox backend', () => {
6363
});
6464

6565
afterEach(() => {
66+
config.requestTimeout = originalTimeout;
6667
rs.stopSync();
6768
rs.disconnect();
6869
Dropbox._rs_cleanup(rs);
@@ -92,10 +93,8 @@ describe('Dropbox backend', () => {
9293
size: CONTENT.length,
9394
content_hash: "3489e9a9d9"
9495
};
95-
fetchMock.mock({name: 'getFile', url: DOWNLOAD_URL}, {status: 200, body: CONTENT, headers: {'Dropbox-API-Result': httpHeaderSafeJson(apiResult)}}, {delay: 10_000});
96+
fetchMock.mock({name: 'getFile', url: DOWNLOAD_URL}, {status: 200, body: CONTENT, headers: {'Dropbox-API-Result': httpHeaderSafeJson(apiResult)}}, {delay: 100});
9697
await expect(dropbox.get('/wug/blicket')).to.be.rejectedWith(/timeout/);
97-
98-
config.requestTimeout = originalTimeout;
9998
});
10099

101100
it("fetchDelta doesn't reject on timeouts", async () => {
@@ -107,8 +106,6 @@ describe('Dropbox backend', () => {
107106
{delay: 100}
108107
);
109108
await expect(dropbox.fetchDelta()).to.be.fulfilled;
110-
111-
config.requestTimeout = originalTimeout;
112109
});
113110

114111
it("fetchDelta fails when offline", async () => {
@@ -897,7 +894,7 @@ describe('Dropbox backend', () => {
897894
await new Promise(resolve => {
898895
const id = setInterval(() => {
899896
if (fetchMock.calls().length >= 2) {
900-
clearTimeout(id);
897+
clearInterval(id);
901898
resolve(null);
902899
}
903900
}, 5);

0 commit comments

Comments
 (0)