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:
npm test runs the tests
npm run-script coverage runs the tests and reports code coverage
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).
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:npm test
runs the testsnpm run-script coverage
runs the tests and reports code coverageNote that currently there are only two tests: a
jshint
check and a superficial test downloading an article with meta-data, parsing it usingparseOpenGraph
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).