mw-dict
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -1,2 +0,2 @@ | ||
const { CollegiateDictionary } = require('../') | ||
const { CollegiateDictionary, WordNotFoundError } = require('../') | ||
@@ -55,1 +55,10 @@ const dict = new CollegiateDictionary('') | ||
}) | ||
describe('error handling', () => { | ||
it('throws error when word could not be found', () => { | ||
return dict.lookup('TEST_INEXIST').catch(e => { | ||
expect(e).toBeInstanceOf(WordNotFoundError) | ||
expect(e.suggestions).toBeInstanceOf(Array) | ||
}) | ||
}) | ||
}) |
@@ -216,3 +216,3 @@ /* | ||
if (!entries.length) { | ||
let suggestions = doc.getElementsByTagName('suggestions') | ||
let suggestions = doc.getElementsByTagName('suggestion') | ||
throw new WordNotFoundError( | ||
@@ -219,0 +219,0 @@ slice.call(suggestions).map(s => textContent(s)) |
{ | ||
"name": "mw-dict", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"main": "lib/index.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
102736
16
353