Skip to content

Tests needed #9

@reggi

Description

@reggi

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.

  1. 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.
  2. 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.
  3. A combination of both methods. (probably wise, however a ton of work)

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions