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

Commit a1b4cee

Browse files
committed
fix deprecations
1 parent daf1eb8 commit a1b4cee

14 files changed

+101
-101
lines changed

test/change.test.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,11 @@ test('apply - replace', function (t) {
154154

155155
// plain
156156
res = Change.apply(single, { cn: ['old'] })
157-
t.deepEqual(res.cn, ['new'])
157+
t.same(res.cn, ['new'])
158158

159159
// multiple
160160
res = Change.apply(single, { cn: ['old', 'also'] })
161-
t.deepEqual(res.cn, ['new'])
161+
t.same(res.cn, ['new'])
162162

163163
// empty
164164
res = Change.apply(empty, { cn: ['existing'] })
@@ -167,15 +167,15 @@ test('apply - replace', function (t) {
167167

168168
// absent
169169
res = Change.apply(single, { dn: ['otherjunk'] })
170-
t.deepEqual(res.cn, ['new'])
170+
t.same(res.cn, ['new'])
171171

172172
// scalar formatting "success"
173173
res = Change.apply(single, { cn: 'old' }, true)
174174
t.equal(res.cn, 'new')
175175

176176
// scalar formatting "failure"
177177
res = Change.apply(twin, { cn: 'old' }, true)
178-
t.deepEqual(res.cn, ['new', 'two'])
178+
t.same(res.cn, ['new', 'two'])
179179

180180
t.end()
181181
})
@@ -192,27 +192,27 @@ test('apply - add', function (t) {
192192

193193
// plain
194194
res = Change.apply(single, { cn: ['old'] })
195-
t.deepEqual(res.cn, ['old', 'new'])
195+
t.same(res.cn, ['old', 'new'])
196196

197197
// multiple
198198
res = Change.apply(single, { cn: ['old', 'also'] })
199-
t.deepEqual(res.cn, ['old', 'also', 'new'])
199+
t.same(res.cn, ['old', 'also', 'new'])
200200

201201
// absent
202202
res = Change.apply(single, { dn: ['otherjunk'] })
203-
t.deepEqual(res.cn, ['new'])
203+
t.same(res.cn, ['new'])
204204

205205
// scalar formatting "success"
206206
res = Change.apply(single, { }, true)
207207
t.equal(res.cn, 'new')
208208

209209
// scalar formatting "failure"
210210
res = Change.apply(single, { cn: 'old' }, true)
211-
t.deepEqual(res.cn, ['old', 'new'])
211+
t.same(res.cn, ['old', 'new'])
212212

213213
// duplicate add
214214
res = Change.apply(single, { cn: 'new' })
215-
t.deepEqual(res.cn, ['new'])
215+
t.same(res.cn, ['new'])
216216

217217
t.end()
218218
})
@@ -229,7 +229,7 @@ test('apply - delete', function (t) {
229229

230230
// plain
231231
res = Change.apply(single, { cn: ['old', 'new'] })
232-
t.deepEqual(res.cn, ['new'])
232+
t.same(res.cn, ['new'])
233233

234234
// empty
235235
res = Change.apply(single, { cn: ['old'] })
@@ -242,7 +242,7 @@ test('apply - delete', function (t) {
242242

243243
// scalar formatting "failure"
244244
res = Change.apply(single, { cn: ['old', 'several', 'items'] }, true)
245-
t.deepEqual(res.cn, ['several', 'items'])
245+
t.same(res.cn, ['several', 'items'])
246246

247247
// absent
248248
res = Change.apply(single, { dn: ['otherjunk'] })

test/client.test.js

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -408,13 +408,13 @@ tap.test('createClient', t => {
408408
// const socketPath = getSock()
409409
// const server = ldap.createServer()
410410
// server.listen(socketPath, () => {})
411-
// t.tearDown(() => {
411+
// t.teardown(() => {
412412
// client.unbind(() => server.close())
413413
// })
414414

415415
// client = ldap.createClient({ socketPath, log: logger })
416416
// t.ok(logger.child)
417-
// t.true(typeof client.log.child === 'function')
417+
// t.ok(typeof client.log.child === 'function')
418418
// })
419419

420420
t.end()
@@ -788,7 +788,7 @@ tap.test('search paged', { timeout: 10000 }, function (t) {
788788
t2.end()
789789
})
790790

791-
t2.tearDown(() => {
791+
t2.teardown(() => {
792792
res.removeListener('searchEntry', entryListener)
793793
res.removeListener('page', pageListener)
794794
})
@@ -999,7 +999,7 @@ tap.test('search - sssvlv', { timeout: 10000 }, function (t) {
999999
})
10001000
res.on('error', (err) => t2.error(err))
10011001
res.on('end', function () {
1002-
t2.equals(count, 10)
1002+
t2.equal(count, 10)
10031003
t2.end()
10041004
})
10051005
})
@@ -1041,7 +1041,7 @@ tap.test('search - sssvlv', { timeout: 10000 }, function (t) {
10411041
})
10421042
res.on('error', (err) => t2.error(err))
10431043
res.on('end', function () {
1044-
t2.equals(count, 10)
1044+
t2.equal(count, 10)
10451045
t2.end()
10461046
})
10471047
})
@@ -1523,10 +1523,10 @@ tap.test('connection refused', function (t) {
15231523
client.on('connectRefused', () => {})
15241524

15251525
client.bind('cn=root', 'secret', function (err, res) {
1526-
t.true(err)
1526+
t.ok(err)
15271527
t.type(err, Error)
1528-
t.equals(err.code, 'ECONNREFUSED')
1529-
t.false(res)
1528+
t.equal(err.code, 'ECONNREFUSED')
1529+
t.notOk(res)
15301530
t.end()
15311531
})
15321532
})
@@ -1551,11 +1551,11 @@ tap.test('connection timeout', function (t) {
15511551
}, 2000)
15521552

15531553
client.bind('cn=root', 'secret', function (err, res) {
1554-
t.true(err)
1554+
t.ok(err)
15551555
t.type(err, Error)
1556-
t.equals(err.message, 'connection timeout')
1556+
t.equal(err.message, 'connection timeout')
15571557
done = true
1558-
t.false(res)
1558+
t.notOk(res)
15591559
t.end()
15601560
})
15611561
})
@@ -1578,9 +1578,9 @@ tap.only('emitError', function (t) {
15781578
t.fail(err)
15791579
})
15801580
client.on('connectTimeout', (err) => {
1581-
t.true(err)
1581+
t.ok(err)
15821582
t.type(err, Error)
1583-
t.equals(err.message, 'connection timeout')
1583+
t.equal(err.message, 'connection timeout')
15841584
clearTimeout(timeout)
15851585
t.end()
15861586
})
@@ -1602,9 +1602,9 @@ tap.only('emitError', function (t) {
16021602
}, 2000)
16031603

16041604
client.on('error', (err) => {
1605-
t.true(err)
1605+
t.ok(err)
16061606
t.type(err, Error)
1607-
t.equals(err.message, 'connectTimeout: connection timeout')
1607+
t.equal(err.message, 'connectTimeout: connection timeout')
16081608
clearTimeout(timeout)
16091609
t.end()
16101610
})
@@ -1623,10 +1623,10 @@ tap.only('emitError', function (t) {
16231623
t.fail(err)
16241624
})
16251625
client.on('connectRefused', (err) => {
1626-
t.true(err)
1626+
t.ok(err)
16271627
t.type(err, Error)
1628-
t.equals(err.message, `connect ECONNREFUSED 0.0.0.0:${unusedPortNumber}`)
1629-
t.equals(err.code, 'ECONNREFUSED')
1628+
t.equal(err.message, `connect ECONNREFUSED 0.0.0.0:${unusedPortNumber}`)
1629+
t.equal(err.code, 'ECONNREFUSED')
16301630
t.end()
16311631
})
16321632

@@ -1641,10 +1641,10 @@ tap.only('emitError', function (t) {
16411641
})
16421642

16431643
client.on('error', (err) => {
1644-
t.true(err)
1644+
t.ok(err)
16451645
t.type(err, Error)
1646-
t.equals(err.message, `connectRefused: connect ECONNREFUSED 0.0.0.0:${unusedPortNumber}`)
1647-
t.equals(err.code, 'ECONNREFUSED')
1646+
t.equal(err.message, `connectRefused: connect ECONNREFUSED 0.0.0.0:${unusedPortNumber}`)
1647+
t.equal(err.code, 'ECONNREFUSED')
16481648
t.end()
16491649
})
16501650

test/controls/paged_results_control.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ test('new with args', function (t) {
2222
t.equal(c.type, '1.2.840.113556.1.4.319')
2323
t.ok(c.criticality)
2424
t.equal(c.value.size, 1000)
25-
t.is(Buffer.compare(c.value.cookie, Buffer.from([1, 2, 3])), 0)
25+
t.equal(Buffer.compare(c.value.cookie, Buffer.from([1, 2, 3])), 0)
2626

2727
const writer = new BerWriter()
2828
c.toBer(writer)
@@ -32,7 +32,7 @@ test('new with args', function (t) {
3232
t.equal(psc.type, '1.2.840.113556.1.4.319')
3333
t.ok(psc.criticality)
3434
t.equal(psc.value.size, 1000)
35-
t.is(Buffer.compare(psc.value.cookie, Buffer.from([1, 2, 3])), 0)
35+
t.equal(Buffer.compare(psc.value.cookie, Buffer.from([1, 2, 3])), 0)
3636

3737
t.end()
3838
})
@@ -55,7 +55,7 @@ test('tober', function (t) {
5555
t.equal(c.type, '1.2.840.113556.1.4.319')
5656
t.ok(c.criticality)
5757
t.equal(c.value.size, 20)
58-
t.is(Buffer.compare(c.value.cookie, Buffer.alloc(0)), 0)
58+
t.equal(Buffer.compare(c.value.cookie, Buffer.alloc(0)), 0)
5959

6060
t.end()
6161
})

test/dn.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,15 +171,15 @@ test('format persists across clone', function (t) {
171171
const OUT = 'UID="user", CN=foo+SN=bar, DC=test, DC=com'
172172
_dn.setFormat({ keepQuote: true, upperName: true })
173173
const clone = _dn.clone()
174-
t.equals(_dn.toString(), OUT)
175-
t.equals(clone.toString(), OUT)
174+
t.equal(_dn.toString(), OUT)
175+
t.equal(clone.toString(), OUT)
176176
t.end()
177177
})
178178

179179
test('initialization', function (t) {
180180
const dn1 = new dn.DN()
181181
t.ok(dn1)
182-
t.equals(dn1.toString(), '')
182+
t.equal(dn1.toString(), '')
183183
t.ok(dn1.isEmpty(), 'DN with no initializer defaults to null DN')
184184

185185
const data = [
@@ -188,7 +188,7 @@ test('initialization', function (t) {
188188
]
189189
const dn2 = new dn.DN(data)
190190
t.ok(dn2)
191-
t.equals(dn2.toString(), 'foo=bar, o=base')
191+
t.equal(dn2.toString(), 'foo=bar, o=base')
192192
t.ok(!dn2.isEmpty())
193193

194194
t.end()

test/laundry.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function search (t, options, callback) {
1414
found = true
1515
})
1616
res.on('end', function () {
17-
t.true(found)
17+
t.ok(found)
1818
if (callback) return callback()
1919
return t.end()
2020
})

test/lib/client/message-tracker/ge-window.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,40 +8,40 @@ test('comp > (ref in upper window) => true', async t => {
88
const ref = Math.floor(MAX_MSGID / 2) + 10
99
const comp = ref + 10
1010
const result = geWindow(ref, comp)
11-
t.is(result, true)
11+
t.equal(result, true)
1212
})
1313

1414
test('comp < (ref in upper window) => false', async t => {
1515
const ref = Math.floor(MAX_MSGID / 2) + 10
1616
const comp = ref - 5
1717
const result = geWindow(ref, comp)
18-
t.is(result, false)
18+
t.equal(result, false)
1919
})
2020

2121
test('comp > (ref in lower window) => true', async t => {
2222
const ref = Math.floor(MAX_MSGID / 2) - 10
2323
const comp = ref + 20
2424
const result = geWindow(ref, comp)
25-
t.is(result, true)
25+
t.equal(result, true)
2626
})
2727

2828
test('comp < (ref in lower window) => false', async t => {
2929
const ref = Math.floor(MAX_MSGID / 2) - 10
3030
const comp = ref - 5
3131
const result = geWindow(ref, comp)
32-
t.is(result, false)
32+
t.equal(result, false)
3333
})
3434

3535
test('(max === MAX_MSGID) && (comp > ref) => true', async t => {
3636
const ref = MAX_MSGID - Math.floor(MAX_MSGID / 2)
3737
const comp = ref + 1
3838
const result = geWindow(ref, comp)
39-
t.is(result, true)
39+
t.equal(result, true)
4040
})
4141

4242
test('(max === MAX_MSGID) && (comp < ref) => false', async t => {
4343
const ref = MAX_MSGID - Math.floor(MAX_MSGID / 2)
4444
const comp = ref - 1
4545
const result = geWindow(ref, comp)
46-
t.is(result, false)
46+
t.equal(result, false)
4747
})

test/lib/client/message-tracker/id-generator.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ const idGeneratorFactory = require('../../../../lib/client/message-tracker/id-ge
77
test('starts at 0', async t => {
88
const nextID = idGeneratorFactory()
99
const currentID = nextID()
10-
t.is(currentID, 1)
10+
t.equal(currentID, 1)
1111
})
1212

1313
test('handles wrapping around', async t => {
1414
const nextID = idGeneratorFactory(MAX_MSGID - 2)
1515

1616
let currentID = nextID()
17-
t.is(currentID, MAX_MSGID - 1)
17+
t.equal(currentID, MAX_MSGID - 1)
1818

1919
currentID = nextID()
20-
t.is(currentID, 1)
20+
t.equal(currentID, 1)
2121
})

0 commit comments

Comments
 (0)