Browse Source

added expected parameters list to _text_addressit

pull/942/head
Lily He 7 years ago
parent
commit
368c0aa4cb
  1. 7
      sanitizer/_text_addressit.js
  2. 6
      test/unit/sanitizer/_text_addressit.js

7
sanitizer/_text_addressit.js

@ -35,9 +35,14 @@ function _sanitize( raw, clean ){
return messages;
}
function _expected(){
return [{ name: 'text' }];
}
// export function
module.exports = () => ({
sanitize: _sanitize
sanitize: _sanitize,
expected: _expected
});
// this is the addressit functionality from https://github.com/pelias/text-analyzer/blob/master/src/addressItParser.js

6
test/unit/sanitizer/_text_addressit.js

@ -339,6 +339,12 @@ module.exports.tests.text_parser = function(test, common) {
});
test('return an array of valid parameters in object form for Joi schema validation', (t) => {
const expected = [{ name: 'text' }];
const validParameters = sanitizer.expected();
t.deepEquals(validParameters, expected);
t.end();
});
};
module.exports.all = function (tape, common) {

Loading…
Cancel
Save