[GH-ISSUE #127] Documentation on writing tests? #106

Closed
opened 2026-03-03 01:23:47 +03:00 by kerem · 1 comment
Owner

Originally created by @JoshuaKGoldberg on GitHub (Jun 22, 2018).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/127

It's not clear from the files under test/ in this repo what the steps are to CRUD tests. Could you write some documentation on this please?

Originally created by @JoshuaKGoldberg on GitHub (Jun 22, 2018). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/127 It's not clear from the files under `test/` in this repo what the steps are to CRUD tests. Could you write some documentation on this please?
kerem 2026-03-03 01:23:47 +03:00
Author
Owner

@DavidAnson commented on GitHub (Jun 22, 2018):

Tests are run by npm test in the usual manner. All tests pass on Windows (my environment, CRLF) and Linux (Coveralls, LF, https://travis-ci.org/DavidAnson/markdownlint/builds/384576202). The test runner is the popular nodeunit (https://github.com/caolan/nodeunit) and test cases are found in test/markdownlint-test.js. Additionally, test/*.md files are enumerated, linted, and pass/fail according to whether every line that triggers a warning has corresponding "{MD###}" text. For example, the line #### Heading 2 {MD001} is expected to trigger MD001. For cases where the marker can not be on the same line, the syntax "{MD###:#}" can be used to identify a different line number. If the sometest.md file needs custom configuration, a sometest.json file is used to provide a custom options.config for that test. For code coverage, run npm run test-cover and for linting, run npm run lint.

<!-- gh-comment-id:399513790 --> @DavidAnson commented on GitHub (Jun 22, 2018): Tests are run by `npm test` in the usual manner. All tests pass on Windows (my environment, CRLF) and Linux (Coveralls, LF, https://travis-ci.org/DavidAnson/markdownlint/builds/384576202). The test runner is the popular `nodeunit` (https://github.com/caolan/nodeunit) and test cases are found in `test/markdownlint-test.js`. Additionally, `test/*.md` files are enumerated, linted, and pass/fail according to whether every line that triggers a warning has corresponding "{MD###}" text. For example, the line `#### Heading 2 {MD001}` is expected to trigger `MD001`. For cases where the marker can not be on the same line, the syntax "{MD###:#}" can be used to identify a different line number. If the `sometest.md` file needs custom configuration, a `sometest.json` file is used to provide a custom `options.config` for that test. For code coverage, run `npm run test-cover` and for linting, run `npm run lint`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/markdownlint#106
No description provided.