Skip to content

Commit becd512

Browse files
committed
format: rm almost empty lines
1 parent e380383 commit becd512

1 file changed

Lines changed: 26 additions & 41 deletions

File tree

tests/unit/test.mapreduce.js

Lines changed: 26 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,11 @@ var utils = PouchDB.utils.mapReduceUtils;
88
describe('test.mapreduce.js-upsert', function () {
99
it('should throw an error if the doc errors', async function () {
1010
try {
11-
await upsert(
12-
{
13-
get: function () {
14-
return Promise.reject(new Error('a fake error!'));
15-
},
11+
await upsert({
12+
get: function () {
13+
return Promise.reject(new Error('a fake error!'));
1614
},
17-
'foo',
18-
);
15+
}, 'foo');
1916

2017
should.fail("Expected promise to be rejected");
2118
} catch (err) {
@@ -24,58 +21,46 @@ describe('test.mapreduce.js-upsert', function () {
2421
});
2522

2623
it('should fulfill if the diff returns false', async function () {
27-
const res = await upsert(
28-
{
29-
get: function () {
30-
return Promise.resolve({ _rev: 'xyz' });
31-
},
24+
const res = await upsert({
25+
get: function () {
26+
return Promise.resolve({ _rev: 'xyz' });
3227
},
33-
'foo',
34-
function () {
35-
return false;
36-
},
37-
);
28+
}, 'foo', function () {
29+
return false;
30+
});
3831

3932
res.updated.should.equal(false);
4033
res.rev.should.equal('xyz');
4134
});
4235

4336
it('should put if get throws 404', async function () {
44-
const res = await upsert(
45-
{
46-
get: function () {
47-
return Promise.reject({ status: 404 });
48-
},
49-
put: function () {
50-
return Promise.resolve({ rev: 'abc' });
51-
},
37+
const res = await upsert({
38+
get: function () {
39+
return Promise.reject({ status: 404 });
5240
},
53-
'foo',
54-
function () {
55-
return { difference: "something" };
41+
put: function () {
42+
return Promise.resolve({ rev: 'abc' });
5643
},
57-
);
44+
}, 'foo', function () {
45+
return { difference: "something" };
46+
});
5847

5948
res.updated.should.equal(true);
6049
res.rev.should.equal('abc');
6150
});
6251

6352
it('should error if it can\'t put', async function () {
6453
try {
65-
await upsert(
66-
{
67-
get: function () {
68-
return Promise.resolve({ _rev: 'xyz' });
69-
},
70-
put: function () {
71-
return Promise.reject(new Error('falala'));
72-
},
54+
await upsert({
55+
get: function () {
56+
return Promise.resolve({ _rev: 'xyz' });
7357
},
74-
'foo',
75-
function () {
76-
return { difference: "something" };
58+
put: function () {
59+
return Promise.reject(new Error('falala'));
7760
},
78-
);
61+
}, 'foo', function () {
62+
return { difference: "something" };
63+
});
7964

8065
should.fail("Expected promise to be rejected");
8166
} catch (err) {

0 commit comments

Comments
 (0)