You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This library needs some form of unit testing. There are over 150 individual functions that make up evalmd, a lot of logging and writing to stdout & stderr, flags, exit codes, relying on package.json, deps that need to be installed. There are two ways of testing evalmd.
I can collect full module / repos. Assert an exit code and evaluate the markdown. Something like testSuccess('https://github.com/ljharb/object.assign', 'README.md') (probably wise to specify commit hash) where this would git clone the repo and run npm install then evaluate the markdown. Ideally I can supply optional flags as well. This method can use nixt to ensure the bin itself works as expected, and the exit code is correct.
I can test each and every function individually which would be great because them I can ensure code coverage. Or because eval-markdown.js returns one function that utilizes every other function I can just test it, however I still run into an issue where I need — not only a single markdown file to test, but a whole environment with package.json and node_modules.
A combination of both methods. (probably wise, however a ton of work)
Thoughts?
The text was updated successfully, but these errors were encountered:
You can test the vast majority by just providing a folder full of example markdown files.
You can then make subdirectories with package.json files and a markdown file to test each of the edge cases of requiring the current package in the example.
This library needs some form of unit testing. There are over 150 individual functions that make up evalmd, a lot of logging and writing to
stdout
&stderr
, flags, exit codes, relying onpackage.json
, deps that need to be installed. There are two ways of testing evalmd.testSuccess('https://github.com/ljharb/object.assign', 'README.md')
(probably wise to specify commit hash) where this wouldgit clone
the repo and runnpm install
then evaluate the markdown. Ideally I can supply optional flags as well. This method can usenixt
to ensure the bin itself works as expected, and the exit code is correct.eval-markdown.js
returns one function that utilizes every other function I can just test it, however I still run into an issue where I need — not only a single markdown file to test, but a whole environment withpackage.json
andnode_modules
.Thoughts?
The text was updated successfully, but these errors were encountered: