Skip to content
This repository was archived by the owner on May 14, 2019. It is now read-only.

Commit 7e2e801

Browse files
committed
style: Fix eslint prettier errors
1 parent 043cb24 commit 7e2e801

File tree

3 files changed

+64
-15
lines changed

3 files changed

+64
-15
lines changed

test/condition.test.js

+48-12
Original file line numberDiff line numberDiff line change
@@ -47,62 +47,98 @@ describe('Condition builder', () => {
4747
});
4848

4949
it('sets the property key', () => {
50-
const cn = new Condition().prop('my_prop').eq('dancing monkeys').build();
50+
const cn = new Condition()
51+
.prop('my_prop')
52+
.eq('dancing monkeys')
53+
.build();
5154
expect(cn).toBe('["my_prop"] == "dancing monkeys"');
5255
});
5356

5457
it('builds boolean condition', () => {
55-
const cn = new Condition().prop('my_prop').is(true).build();
58+
const cn = new Condition()
59+
.prop('my_prop')
60+
.is(true)
61+
.build();
5662
expect(cn).toBe('["my_prop"] is true');
5763
});
5864

5965
it('builds equality condition', () => {
60-
const cn = new Condition().prop('my_prop').eq('dancing monkeys').build();
66+
const cn = new Condition()
67+
.prop('my_prop')
68+
.eq('dancing monkeys')
69+
.build();
6170
expect(cn).toBe('["my_prop"] == "dancing monkeys"');
6271
});
6372

6473
it('builds inequality condition', () => {
65-
const cn = new Condition().prop('my_prop').ne('dancing monkeys').build();
74+
const cn = new Condition()
75+
.prop('my_prop')
76+
.ne('dancing monkeys')
77+
.build();
6678
expect(cn).toBe('["my_prop"] != "dancing monkeys"');
6779
});
6880

6981
it('builds less than condition', () => {
70-
const cn = new Condition().prop('my_prop').lt(299792458).build();
82+
const cn = new Condition()
83+
.prop('my_prop')
84+
.lt(299792458)
85+
.build();
7186
expect(cn).toBe('["my_prop"] < 299792458');
7287
});
7388

7489
it('builds less than or equal to condition', () => {
75-
const cn = new Condition().prop('my_prop').lte(299792458).build();
90+
const cn = new Condition()
91+
.prop('my_prop')
92+
.lte(299792458)
93+
.build();
7694
expect(cn).toBe('["my_prop"] <= 299792458');
7795
});
7896

7997
it('builds greater than condition', () => {
80-
const cn = new Condition().prop('my_prop').gt(299792458).build();
98+
const cn = new Condition()
99+
.prop('my_prop')
100+
.gt(299792458)
101+
.build();
81102
expect(cn).toBe('["my_prop"] > 299792458');
82103
});
83104

84105
it('builds greater than or equal to condition', () => {
85-
const cn = new Condition().prop('my_prop').gte(299792458).build();
106+
const cn = new Condition()
107+
.prop('my_prop')
108+
.gte(299792458)
109+
.build();
86110
expect(cn).toBe('["my_prop"] >= 299792458');
87111
});
88112

89113
it('builds property exists condition', () => {
90-
const cn = new Condition().prop('one_piece').exists().build();
114+
const cn = new Condition()
115+
.prop('one_piece')
116+
.exists()
117+
.build();
91118
expect(cn).toBe('["one_piece"] exists');
92119
});
93120

94121
it('builds property missing condition', () => {
95-
const cn = new Condition().prop('the_last_airbender').missing().build();
122+
const cn = new Condition()
123+
.prop('the_last_airbender')
124+
.missing()
125+
.build();
96126
expect(cn).toBe('["the_last_airbender"] missing');
97127
});
98128

99129
it('builds contains condition', () => {
100-
const cn = new Condition().prop('potion').contains('magic').build();
130+
const cn = new Condition()
131+
.prop('potion')
132+
.contains('magic')
133+
.build();
101134
expect(cn).toBe('["potion"] contains "magic"');
102135
});
103136

104137
it('builds notcontains condition', () => {
105-
const cn = new Condition().prop('anime').notContains('fillers').build();
138+
const cn = new Condition()
139+
.prop('anime')
140+
.notContains('fillers')
141+
.build();
106142
expect(cn).toBe('["anime"] !contains "fillers"');
107143
});
108144

test/parse.test.js

+12-2
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,12 @@ describe('parse', () => {
106106
test(`${cnNamesMap[cn1]} and ${cnNamesMap[cn2]} and ${cnNamesMap[
107107
cn3
108108
]}`, () => {
109-
const qry = parse(muto.where(cnMap[cn1]).and(cnMap[cn2]).and(cnMap[cn3]));
109+
const qry = parse(
110+
muto
111+
.where(cnMap[cn1])
112+
.and(cnMap[cn2])
113+
.and(cnMap[cn3])
114+
);
110115

111116
expect(qry).toBeInstanceOf(bob.BoolQuery);
112117
expect(qry).toEqual(
@@ -115,7 +120,12 @@ describe('parse', () => {
115120
});
116121

117122
test(`${cnNamesMap[cn1]} or ${cnNamesMap[cn2]} or ${cnNamesMap[cn3]}`, () => {
118-
const qry = parse(muto.where(cnMap[cn1]).or(cnMap[cn2]).or(cnMap[cn3]));
123+
const qry = parse(
124+
muto
125+
.where(cnMap[cn1])
126+
.or(cnMap[cn2])
127+
.or(cnMap[cn3])
128+
);
119129

120130
expect(qry).toBeInstanceOf(bob.BoolQuery);
121131
expect(qry).toEqual(

test/where.test.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ describe('Where builder', () => {
4141
});
4242

4343
it('can handle nested conditions', () => {
44-
const where = new Where(cn1).and(cn2).and(new Where(strCn1).or(strCn2)).build();
44+
const where = new Where(cn1)
45+
.and(cn2)
46+
.and(new Where(strCn1).or(strCn2))
47+
.build();
4548
expect(where).toBe(
4649
`(${cn1.build()} and ${cn2.build()} and (${strCn1} or ${strCn2}))`
4750
);

0 commit comments

Comments
 (0)