Skip to content

Commit 0b02130

Browse files
committed
Fix the tests to async, thanks @megoth
1 parent 2b6a272 commit 0b02130

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

lib/utils.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,6 @@ async function getQuota (root, serverUri) {
290290

291291
async function overQuota (root, serverUri) {
292292
let quota = await getQuota(root, serverUri)
293-
console.log(root, quota)
294293
if (quota === Infinity) {
295294
return false
296295
}

test/integration/quota-test.js

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,31 @@ describe('Get Quota', function () {
1212
expect(prefs).to.be.a('string')
1313
expect(prefs).to.match(/storageQuota/)
1414
})
15-
it('Get the quota', function (done) {
16-
expect(getQuota(path.join('test/resources/', root), 'https://localhost')).to.eventually.equal(2000)
15+
it('Get the quota', async function () {
16+
const quota = await getQuota(path.join('test/resources/', root), 'https://localhost')
17+
expect(quota).to.equal(2000)
1718
})
18-
/* it('Get the quota with non-existant file', function () {
19-
expect(getQuota(path.join('nowhere/', root), 'https://localhost')).to.equal(Infinity)
19+
it('Get the quota with non-existant file', async function () {
20+
const quota = await getQuota(path.join('nowhere/', root), 'https://localhost')
21+
expect(quota).to.equal(Infinity)
22+
})
23+
it('Get the quota when the predicate is not present', async function () {
24+
const quota = await getQuota('test/resources/accounts-acl/quota', 'https://localhost')
25+
expect(quota).to.equal(Infinity)
2026
})
21-
it('Get the quota when the predicate is not present', function () {
22-
expect(getQuota('test/resources/accounts-acl/quota', 'https://localhost')).to.equal(Infinity)
23-
}) */
2427
})
2528

2629
describe('Check if over Quota', function () {
27-
it('Check the quota', function () {
28-
expect(overQuota(path.join('test/resources/', root), 'https://localhost')).to.be.true
30+
it('Check the quota', async function () {
31+
const quota = await overQuota(path.join('test/resources/', root), 'https://localhost')
32+
expect(quota).to.be.true
2933
})
30-
it('Check the quota with non-existant file', function () {
31-
expect(overQuota(path.join('nowhere/', root), 'https://localhost')).to.be.false
34+
it('Check the quota with non-existant file', async function () {
35+
const quota = await overQuota(path.join('nowhere/', root), 'https://localhost')
36+
expect(quota).to.be.false
3237
})
33-
it('Check the quota when the predicate is not present', function () {
34-
expect(overQuota('test/resources/accounts-acl/quota', 'https://localhost')).to.be.false()
38+
it('Check the quota when the predicate is not present', async function () {
39+
const quota = await overQuota('test/resources/accounts-acl/quota', 'https://localhost')
40+
expect(quota).to.be.false
3541
})
3642
})

0 commit comments

Comments
 (0)