Skip to content

Commit a930072

Browse files
committed
update major dependencies, remove dirty-chai
1 parent 2a0a286 commit a930072

15 files changed

Lines changed: 364 additions & 405 deletions

package-lock.json

Lines changed: 222 additions & 263 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,26 +61,25 @@
6161
"@babel/preset-env": "^7.28.5",
6262
"@babel/preset-typescript": "^7.28.5",
6363
"@babel/register": "^7.28.3",
64-
"@types/chai": "^4.3.20",
64+
"@types/chai": "^5.2.3",
6565
"@types/dirty-chai": "^2.0.5",
66-
"@types/express": "^4.17.25",
66+
"@types/express": "^5.0.6",
6767
"@types/jsonld": "^1.5.15",
6868
"@types/mocha": "^10.0.10",
69-
"@types/sinon-chai": "^3.2.12",
69+
"@types/sinon-chai": "^4.0.0",
7070
"babel-loader": "^10.0.0",
71-
"chai": "^4.5.0",
71+
"chai": "^6.2.1",
7272
"colors": "^1.4.0",
7373
"diff": "^8.0.2",
74-
"dirty-chai": "^2.0.1",
75-
"eslint": "^9.39.1",
74+
"eslint": "^9.39.2",
7675
"locate-path": "^8.0.0",
7776
"mocha": "^11.7.5",
7877
"nock": "^13.5.6",
7978
"node-fetch": "^3.3.2",
8079
"node-polyfill-webpack-plugin": "^4.1.0",
8180
"rimraf": "^6.1.2",
8281
"sinon": "^21.0.0",
83-
"sinon-chai": "^3.7.0",
82+
"sinon-chai": "^4.0.1",
8483
"source-map-loader": "^5.0.0",
8584
"ts-node": "^10.9.2",
8685
"typedoc": "^0.28.15",

tests/unit/fetcher-egp-test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe('Fetcher', () => {
2323
let kb = rdf.graph();
2424
let fetcher = rdf.fetcher(kb, {a:1})
2525
fetcher.nowOrWhenFetched(kb.sym(goodServer + path), {force: true}, trywrap(done, function (ok, statusOrErrorText, resp) {
26-
expect(ok).to.be.true()
26+
expect(ok).to.equal(true) // .true()
2727
expect(resp.status).to.equal(200)
2828
expect(statusOrErrorText).to.equal('OK')
2929
expect(resp.responseText.length).to.equal(bodyText.length)
@@ -52,7 +52,7 @@ describe('Fetcher', () => {
5252
console.log('@@@@@@ resp is ' + resp)
5353
console.log('@@@@@@ resp.status is ' + resp.status)
5454

55-
expect(ok).to.be.false()
55+
expect(ok).to.equal(false) // .false()
5656
expect(statusOrErrorText).to.include(404)
5757
expect(resp.status).to.match(/404/)
5858
}))
@@ -65,7 +65,7 @@ describe('Fetcher', () => {
6565
let kb = rdf.graph();
6666
let fetcher = rdf.fetcher(kb, {a:1})
6767
fetcher.nowOrWhenFetched(kb.sym(badServer + path), {force: true}, trywrap(done, function (ok, statusOrErrorText, resp) {
68-
expect(ok).to.be.false()
68+
expect(ok).to.equal(false) // .false()
6969
expect(statusOrErrorText).to.match(/(ENOTFOUND|Failed to load .*)/)
7070
expect(resp.status).to.equal(999)
7171
}))
@@ -83,7 +83,7 @@ describe('Fetcher', () => {
8383
let kb = rdf.graph();
8484
let fetcher = rdf.fetcher(kb, {a:1})
8585
fetcher.nowOrWhenFetched(kb.sym(goodServer + path), {force: true}, trywrap(done, function (ok, statusOrErrorText, resp) {
86-
expect(ok).to.be.false;
86+
expect(ok).to.equal(false) // .false()
8787
expect(statusOrErrorText).to.match(/Failed to load/) // Nock: No match for request/); //)
8888
expect(resp.status).to.equal(404) // 999)
8989
}))

tests/unit/fetcher-test.js

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import chai from 'chai'
55
import sinon from 'sinon'
66
import sinonChai from 'sinon-chai'
7-
import dirtyChai from 'dirty-chai'
7+
// import dirtyChai from 'dirty-chai'
88
import nock from 'nock'
99

1010
import * as rdf from '../../src/index'
@@ -14,7 +14,7 @@ import CanonicalDataFactory from '../../src/factories/canonical-data-factory'
1414
import { Headers, Response } from 'cross-fetch'
1515

1616
chai.use(sinonChai)
17-
chai.use(dirtyChai)
17+
// chai.use(dirtyChai)
1818
const { expect } = chai
1919
chai.should()
2020

@@ -47,7 +47,7 @@ describe('Fetcher', () => {
4747
}
4848
let fetcher = new Fetcher()
4949

50-
expect(fetcher.store.fetcher === fetcher).to.be.true()
50+
expect(fetcher.store.fetcher === fetcher).to.equal(true)
5151
})
5252
})
5353

@@ -84,7 +84,7 @@ describe('Fetcher', () => {
8484
options.resource,
8585
store.rdfFactory.namedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'),
8686
store.rdfFactory.namedNode('http://www.w3.org/ns/iana/media-types/image/png#Resource')
87-
)).to.be.true()
87+
)).to.equal(true)
8888
})
8989
})
9090

@@ -105,7 +105,7 @@ describe('Fetcher', () => {
105105
fetcher._fetch = sinon.stub().rejects(new Error(errorMessage))
106106

107107
fetcher.nowOrWhenFetched(docuri, (ok, message) => {
108-
expect(ok).to.be.false()
108+
expect(ok).to.equal(false)
109109
expect(message).to.include(errorMessage)
110110
done()
111111
})
@@ -130,7 +130,7 @@ describe('Fetcher', () => {
130130
it('nowOrWhenFetched(uri, userCallback)', done => {
131131
fetcher.nowOrWhenFetched(docuri, (ok, text, response) => {
132132
expect(fetcher.load).to.have.been.calledWith(docuri, {})
133-
expect(ok).to.be.true()
133+
expect(ok).to.equal(true)
134134
expect(response.status).to.equal(200)
135135
done()
136136
})
@@ -140,15 +140,14 @@ describe('Fetcher', () => {
140140
let options = {}
141141
fetcher.nowOrWhenFetched(docuri, options, (ok, text, response) => {
142142
expect(fetcher.load).to.have.been.calledWith(docuri, options)
143-
expect(ok).to.be.true()
143+
expect(ok).to.equal(true)
144144
done()
145145
})
146146
})
147-
148147
it('nowOrWhenFetched(uri, referringTerm, userCallback, options)', done => {
149148
userCallback = (ok) => {
150149
expect(fetcher.load).to.have.been.calledWith(docuri, { referringTerm: rterm })
151-
expect(ok).to.be.true()
150+
expect(ok).equal(true)
152151
done()
153152
}
154153
fetcher.nowOrWhenFetched(docuri, rterm, userCallback, options)
@@ -157,7 +156,7 @@ describe('Fetcher', () => {
157156
it('nowOrWhenFetched(uri, undefined, userCallback, options)', done => {
158157
userCallback = (ok) => {
159158
expect(fetcher.load).to.have.been.calledWith(docuri, {})
160-
expect(ok).to.be.true()
159+
expect(ok).to.equal(true)
161160
done()
162161
}
163162
fetcher.nowOrWhenFetched(docuri, undefined, userCallback, options)
@@ -166,7 +165,7 @@ describe('Fetcher', () => {
166165
it('nowOrWhenFetched(uri, referringTerm, userCallback)', done => {
167166
fetcher.nowOrWhenFetched(docuri, rterm, (ok) => {
168167
expect(fetcher.load).to.have.been.calledWith(docuri, { referringTerm: rterm })
169-
expect(ok).to.be.true()
168+
expect(ok).to.equal(true)
170169
done()
171170
})
172171
})
@@ -206,7 +205,7 @@ describe('Fetcher', () => {
206205
it('should mark the uri as requested', () => {
207206
return fetcher.load(uri, options)
208207
.then(() => {
209-
expect(fetcher.requested[uri]).to.be.true()
208+
expect(fetcher.requested[uri]).to.equal(true)
210209
})
211210
})
212211

@@ -215,7 +214,7 @@ describe('Fetcher', () => {
215214

216215
return fetcher.load(uri, options)
217216
.then(() => {
218-
expect(fetcher.saveRequestMetadata).to.have.been.called()
217+
expect(fetcher.saveRequestMetadata).to.have.been.calledOnce // called()
219218
})
220219
})
221220

@@ -226,7 +225,7 @@ describe('Fetcher', () => {
226225

227226
return fetcher.load(uri, options)
228227
.then(() => {
229-
expect(fetcher.saveRequestMetadata).to.not.have.been.called()
228+
expect(fetcher.saveRequestMetadata).to.not.have.been.calledOnce // to.not.have.been.called(1)
230229
})
231230
})
232231

@@ -248,10 +247,10 @@ describe('Fetcher', () => {
248247

249248
return fetcher.load(uri, options)
250249
.then(response => {
251-
expect(response.ok).to.be.true()
250+
expect(response.ok).to.equal(true)
252251
expect(response.status).to.equal(200)
253-
expect(fetcher._fetch).to.not.have.been.called()
254-
expect(fetcher.handleError).to.not.have.been.called()
252+
expect(fetcher._fetch).to.not.have.been.calledOnce // to.have.been.called(0)
253+
expect(fetcher.handleError).to.not.have.been.calledOnce // to.have.been.called(0)
255254
expect(fetcher.requested[uri]).to.equal('done')
256255
})
257256
})
@@ -261,9 +260,9 @@ describe('Fetcher', () => {
261260

262261
return fetcher.load(uri, options)
263262
.then(response => {}, error => {
264-
expect(error.message.includes('Previously failed:')).to.be.true()
265-
expect(fetcher._fetch).to.not.have.been.called()
266-
expect(fetcher.handleError).to.not.have.been.called()
263+
expect(error.message.includes('Previously failed:')).to.equal(true)
264+
expect(fetcher._fetch).to.not.have.been.calledOnce // to.not.have.been.called()
265+
expect(fetcher.handleError).to.not.have.been.calledOnce // to.not.have.been.called()
267266
})
268267
})
269268

@@ -272,7 +271,7 @@ describe('Fetcher', () => {
272271

273272
return fetcher.load(uri, options)
274273
.then(() => {
275-
expect(fetcher.nonexistent[uri]).to.be.true()
274+
expect(fetcher.nonexistent[uri]).to.equal(true)
276275
})
277276
})
278277
})
@@ -285,7 +284,7 @@ describe('Fetcher', () => {
285284

286285
return fetcher.load(uri, options)
287286
.then(() => {
288-
expect(fetcher.nonexistent[uri]).to.be.undefined()
287+
expect(fetcher.nonexistent[uri]).to.equal(undefined) // to.be.undefined()
289288
})
290289
})
291290
})
@@ -338,7 +337,7 @@ describe('Fetcher', () => {
338337
delete fetcher.requested[uri]
339338
return fetcher.webOperation('PATCH', uri, options) // load() is not usable for PATCH
340339
.then(result => {}, () => {
341-
expect(fetcher.requested[uri]).to.not.exist()
340+
expect(fetcher.requested[uri]).to.equal(undefined) // to.not.exist()
342341
})
343342
})
344343
})
@@ -424,15 +423,15 @@ describe('Fetcher', () => {
424423
let options = { credentials: true }
425424

426425
Fetcher.setCredentials(uri, options)
427-
expect(options.credentials).to.be.true()
426+
expect(options.credentials).to.equal(true)
428427
})
429428

430429
it('should return false for an https uri with an override', () => {
431430
let uri = 'https://example.com/newdoc2.ttl'
432431
let options = { credentials: false }
433432

434433
Fetcher.setCredentials(uri, options)
435-
expect(options.credentials).to.be.false()
434+
expect(options.credentials).to.equal(false)
436435
})
437436
})
438437

tests/unit/indexed-formula-test.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,16 @@ describe('IndexedFormula', () => {
143143
])
144144

145145
expect(store.statements.length).to.eq(2)
146-
expect(store.holds(s1, p1, o1)).to.be.true()
147-
expect(store.holds(s2, p2, o2)).to.be.true()
146+
expect(store.holds(s1, p1, o1)).to.equal(true)
147+
expect(store.holds(s2, p2, o2)).to.equal(true)
148148
})
149149

150150
it ('works with statements', () => {
151151
const store = new IndexedFormula()
152152
store.add(triple1)
153153

154154
expect(store.statements.length).to.eq(1)
155-
expect(store.holds(s1, p1, o1)).to.be.true()
155+
expect(store.holds(s1, p1, o1)).to.equal(true)
156156
})
157157

158158
it ('works with stores', () => {
@@ -163,16 +163,16 @@ describe('IndexedFormula', () => {
163163
store.add(store0)
164164

165165
expect(store.statements.length).to.eq(2)
166-
expect(store.holds(s1, p1, o1)).to.be.true()
167-
expect(store.holds(s2, p2, o2)).to.be.true()
166+
expect(store.holds(s1, p1, o1)).to.equal(true)
167+
expect(store.holds(s2, p2, o2)).to.equal(true)
168168
})
169169

170170
it ('works with terms as separate arguments', () => {
171171
const store = new IndexedFormula()
172172
store.add(s1, p1, o1)
173173

174174
expect(store.statements.length).to.eq(1)
175-
expect(store.holds(triple1)).to.be.true()
175+
expect(store.holds(triple1)).to.equal(true)
176176
})
177177

178178
it('calls the data callback', () => {
@@ -249,8 +249,8 @@ describe('IndexedFormula', () => {
249249
])
250250

251251
expect(store.statements.length).to.eq(0)
252-
expect(store.holds(s1, p1, o1)).to.be.false()
253-
expect(store.holds(s2, p2, o2)).to.be.false()
252+
expect(store.holds(s1, p1, o1)).to.equal(false)
253+
expect(store.holds(s2, p2, o2)).to.equal(false)
254254
})
255255

256256
it ('works with statements', () => {
@@ -260,7 +260,7 @@ describe('IndexedFormula', () => {
260260
store.remove(triple1)
261261

262262
expect(store.statements.length).to.eq(0)
263-
expect(store.holds(s1, p1, o1)).to.be.false()
263+
expect(store.holds(s1, p1, o1)).to.equal(false)
264264
})
265265

266266
it ('works with stores', () => {
@@ -273,8 +273,8 @@ describe('IndexedFormula', () => {
273273
store.remove(store0)
274274

275275
expect(store.statements.length).to.eq(0)
276-
expect(store.holds(s1, p1, o1)).to.be.false()
277-
expect(store.holds(s2, p2, o2)).to.be.false()
276+
expect(store.holds(s1, p1, o1)).to.equal(false)
277+
expect(store.holds(s2, p2, o2)).to.equal(false)
278278
})
279279
});
280280

@@ -292,7 +292,7 @@ describe('IndexedFormula', () => {
292292
const store = new IndexedFormula()
293293
try {
294294
store.removeStatement(triple1)
295-
expect(true).to.be.false()
295+
expect(true).to.equal(false)
296296
} catch (e) {
297297
expect(e.message).to.include('RDFArrayRemove: Array did not contain')
298298
}
@@ -307,7 +307,7 @@ describe('IndexedFormula', () => {
307307
store.removeMany(triple1.subject, null, null, null)
308308

309309
expect(store.statements.length).to.eq(1)
310-
expect(store.holds(s2, p2, o2)).to.be.true()
310+
expect(store.holds(s2, p2, o2)).to.equal(true)
311311
})
312312

313313
it ('removes a limited number of matching statements', () => {
@@ -328,7 +328,7 @@ describe('IndexedFormula', () => {
328328
store.removeMatches(null, null, triple3.object, null)
329329

330330
expect(store.statements.length).to.eq(1)
331-
expect(store.holds(s2, p2, o2)).to.be.true()
331+
expect(store.holds(s2, p2, o2)).to.equal(true)
332332
})
333333
it ('does the same as remove of matches', () => {
334334
const store0 = new IndexedFormula()
@@ -338,8 +338,8 @@ describe('IndexedFormula', () => {
338338
store0.remove(store0.match(null, null, triple3.object, null))
339339
store1.removeMatches(null, null, triple3.object, null)
340340

341-
expect(store0.holdsStatement(store1)).to.be.true()
342-
expect(store1.holdsStatement(store0)).to.be.true()
341+
expect(store0.holdsStatement(store1)).to.equal(true)
342+
expect(store1.holdsStatement(store0)).to.equal(true)
343343
})
344344
});
345345
describe('removeDocument', () => {

tests/unit/literal-test.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,17 +129,17 @@ describe('Literal', () => {
129129
it('compares termType, value, language, and datatype', () => {
130130
const a = new Literal('hello world', 'en', XSD.langString)
131131
const b = new Literal('', '', null)
132-
expect(a.equals(b)).to.be.false()
133-
expect(b.equals(a)).to.be.false()
132+
expect(a.equals(b)).to.equal(false)
133+
expect(b.equals(a)).to.equal(false)
134134
b.value = 'hello world'
135-
expect(a.equals(b)).to.be.false()
136-
expect(b.equals(a)).to.be.false()
135+
expect(a.equals(b)).to.equal(false)
136+
expect(b.equals(a)).to.equal(false)
137137
b.language = 'en'
138-
expect(a.equals(b)).to.be.false()
139-
expect(b.equals(a)).to.be.false()
138+
expect(a.equals(b)).to.equal(false)
139+
expect(b.equals(a)).to.equal(false)
140140
b.datatype = XSD.langString
141-
expect(a.equals(b)).to.be.true()
142-
expect(b.equals(a)).to.be.true()
141+
expect(a.equals(b)).to.equal(true)
142+
expect(b.equals(a)).to.equal(true)
143143
})
144144
})
145145
})

0 commit comments

Comments
 (0)