wikimedia / html-metadata

MetaData html scraper and parser for Node.js (supports Promises and callback style)
MIT License
169 stars 44 forks source link

Some minor fixes + a simple test suite #13

Closed d00rman closed 9 years ago

d00rman commented 9 years ago

This PR fixes some minor code issues and adds a .gitignore file. Furthermore, it adds a simple test suite using mocha and code coverage via istanbul:

Note that currently there are only two tests: a jshint check and a superficial test downloading an article with meta-data, parsing it using parseOpenGraph and checking if some fields are present in the response. Needless to say, this should be considered only the beginning - we should develop more tests (at least one for each exported function), and also be more strict (tests should check corner cases as well as common use-cases).