1- /* global describe, expect, it */
2-
1+ const { strictEqual } = require ( 'assert' )
2+ const { describe , it } = require ( 'mocha' )
33const nock = require ( 'nock' )
44const rdf = require ( '@rdfjs/dataset' )
55const rdfFetch = require ( '..' )
66const SinkMap = require ( '@rdfjs/sink-map' )
77
88describe ( '@rdfjs/fetch' , ( ) => {
99 it ( 'should be a function' , ( ) => {
10- expect ( typeof rdfFetch ) . toBe ( 'function' )
10+ strictEqual ( typeof rdfFetch , 'function' )
1111 } )
1212
1313 it ( 'should return a Promise' , ( ) => {
1414 const result = rdfFetch ( 'http://example.org/' )
1515
16- expect ( typeof result ) . toBe ( 'object' )
17- expect ( typeof result . then ) . toBe ( 'function' )
16+ strictEqual ( typeof result , 'object' )
17+ strictEqual ( typeof result . then , 'function' )
1818 } )
1919
2020 it ( 'should use formats common as default formats' , async ( ) => {
@@ -30,14 +30,18 @@ describe('@rdfjs/fetch', () => {
3030
3131 await rdfFetch ( 'http://example.org/formats-common' )
3232
33- expect ( [
33+ const mediaTypes = [
3434 'application/ld+json' ,
3535 'application/trig' ,
3636 'application/n-quads' ,
3737 'application/n-triples' ,
3838 'text/n3' ,
3939 'text/turtle'
40- ] . every ( mediaType => accept . includes ( mediaType ) ) ) . toBe ( true )
40+ ]
41+
42+ mediaTypes . forEach ( mediaType => {
43+ strictEqual ( accept . includes ( mediaType ) , true )
44+ } )
4145 } )
4246
4347 it ( 'should support custom formats' , async ( ) => {
@@ -62,7 +66,7 @@ describe('@rdfjs/fetch', () => {
6266 formats : customFormats
6367 } )
6468
65- expect ( accept ) . toBe ( 'application/ld+json, text/turtle' )
69+ strictEqual ( accept , 'application/ld+json, text/turtle' )
6670 } )
6771
6872 it ( 'should use @rdfjs/dataset as default factory' , async ( ) => {
@@ -73,7 +77,7 @@ describe('@rdfjs/fetch', () => {
7377 const res = await rdfFetch ( 'http://example.org/factory-default' )
7478 const dataset = await res . dataset ( )
7579
76- expect ( dataset instanceof rdf . dataset ( ) . constructor ) . toBe ( true )
80+ strictEqual ( dataset instanceof rdf . dataset ( ) . constructor , true )
7781 } )
7882
7983 it ( 'should support custom factory' , async ( ) => {
@@ -93,6 +97,6 @@ describe('@rdfjs/fetch', () => {
9397 } )
9498 const dataset = await res . dataset ( )
9599
96- expect ( dataset instanceof CustomDataset ) . toBe ( true )
100+ strictEqual ( dataset instanceof CustomDataset , true )
97101 } )
98102} )
0 commit comments