Skip to content

Commit 8b0a09c

Browse files
committed
Fix tests
1 parent cbbdb99 commit 8b0a09c

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

src/aql-query.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default function aql (strings, ...args) {
1414
let name = `value${isKnown ? index : bindVals.length}`
1515
if (rawValue && rawValue.isArangoCollection) {
1616
name = `@${name}`
17-
value = rawValue.name()
17+
value = rawValue.name
1818
}
1919
if (!isKnown) {
2020
bindVals.push(rawValue)

src/connection.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ export default class Connection {
3535
}
3636
if (opts.path) pathname += opts.path
3737
if (opts.qs) {
38-
if (typeof opts.qs === 'string') search = opts.qs
39-
else search = qs.stringify(opts.qs)
38+
if (typeof opts.qs === 'string') search = `?${opts.qs}`
39+
else search = `?${qs.stringify(opts.qs)}`
4040
}
4141
return search ? {pathname, search} : {pathname}
4242
}

test/00-basics.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ describe('Configuring the driver', () => {
4747
expect(headers).to.have.a.property('x-two', '2')
4848
done()
4949
}
50-
conn.request()
50+
conn.request({headers: {}})
5151
})
5252
})
5353
describe('with an arangoVersion', () => {
@@ -57,7 +57,7 @@ describe('Configuring the driver', () => {
5757
expect(headers).to.have.a.property('x-arango-version', 99999)
5858
done()
5959
}
60-
conn.request()
60+
conn.request({headers: {}})
6161
})
6262
it('does not overwrite explicit headers', (done) => {
6363
const conn = new Connection({
@@ -68,7 +68,7 @@ describe('Configuring the driver', () => {
6868
expect(headers).to.have.a.property('x-arango-version', 66666)
6969
done()
7070
}
71-
conn.request()
71+
conn.request({headers: {}})
7272
})
7373
})
7474
describe('with agentOptions', () => {
@@ -140,28 +140,28 @@ describe('Configuring the driver', () => {
140140
let agent = 1
141141
let conn
142142
conn = new Connection({agent}) // default: http
143-
conn.request()
143+
conn.request({headers: {}})
144144
expect(options).to.have.a.property('agent', agent)
145145
agent++
146146
conn = new Connection({agent, url: 'https://localhost:8529'})
147-
conn.request()
147+
conn.request({headers: {}})
148148
expect(options).to.have.a.property('agent', agent)
149149
agent++
150150
conn = new Connection({agent, url: 'http://localhost:8529'})
151-
conn.request()
151+
conn.request({headers: {}})
152152
expect(options).to.have.a.property('agent', agent)
153153
})
154154
it('uses the request function for the protocol', () => {
155155
const agent = 1
156156
let conn
157157
conn = new Connection({agent}) // default: http
158-
conn.request()
158+
conn.request({headers: {}})
159159
expect(protocol).to.equal('http')
160160
conn = new Connection({agent, url: 'https://localhost:8529'})
161-
conn.request()
161+
conn.request({headers: {}})
162162
expect(protocol).to.equal('https')
163163
conn = new Connection({agent, url: 'http://localhost:8529'})
164-
conn.request()
164+
conn.request({headers: {}})
165165
expect(protocol).to.equal('http')
166166
})
167167
})

test/05-aql-queries.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ describe('AQL queries', () => {
120120
this.name = 'tomato'
121121
}
122122
}
123+
ArangoCollection.prototype.isArangoCollection = true
123124
let collection = new ArangoCollection()
124125
let aql = aqlQuery`${collection}`
125126
expect(aql.query).to.equal('@@value0')

0 commit comments

Comments
 (0)