-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** | ||
* Misc tests. | ||
*/ | ||
// disable so tests can be copy & pasted | ||
/* eslint-disable quotes, quote-props */ | ||
const rdfCanonize = require('..'); | ||
const assert = require('assert'); | ||
|
||
describe.only('API tests', () => { | ||
it('should reject invalid inputFormat', async () => { | ||
let error; | ||
try { | ||
await rdfCanonize.canonize('', { | ||
algorithm: 'URDNA2015', | ||
inputFormat: 'application/bogus', | ||
format: 'application/n-quads' | ||
}); | ||
} catch(e) { | ||
error = e; | ||
} | ||
assert(error); | ||
}); | ||
|
||
it('should fail to parse empty dataset as N-Quads', async () => { | ||
let error; | ||
try { | ||
await rdfCanonize.canonize([], { | ||
algorithm: 'URDNA2015', | ||
inputFormat: 'application/bogus', | ||
format: 'application/n-quads' | ||
}); | ||
} catch(e) { | ||
error = e; | ||
} | ||
assert(error); | ||
}); | ||
|
||
it('should fail to parse empty legacy dataset as N-Quads', async () => { | ||
let error; | ||
try { | ||
await rdfCanonize.canonize({}, { | ||
algorithm: 'URDNA2015', | ||
inputFormat: 'application/bogus', | ||
format: 'application/n-quads' | ||
}); | ||
} catch(e) { | ||
error = e; | ||
} | ||
assert(error); | ||
}); | ||
}); |