Skip to content

Commit

Permalink
add tests for linkref children nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
WillForan committed Jan 2, 2024
1 parent bfa29a3 commit 749034a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion rules/list-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function validateListItemLinkChildren(link, file) {
return false;
}
}
return true;
return true;

Check failure on line 137 in rules/list-item.js

View workflow job for this annotation

GitHub Actions / Node.js 20

Expected blank line before this statement.

Check failure on line 137 in rules/list-item.js

View workflow job for this annotation

GitHub Actions / Node.js 18

Expected blank line before this statement.
}

function validateListItemLink(link, file) {
Expand Down
7 changes: 4 additions & 3 deletions test/fixtures/list-item/0.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ All list-items in this document should be linted as **valid**.
- [foo](https://foo.com) - Valid sub-item.
- [foo](https://foo.com) - Valid sub-item.
- [foo](https://foo.com) - Valid sub-sub-item!!!!!
- [foo](https://foo.com) - GitHub's descriptions can also be valid.
- [foo](https://foo.com) - GitHub's descriptions can also be valid.
- [foo-bar](https://foo-bar.com) - Valid description.
- 👍 [foo](https://foo-bar.com) - Valid description.

Expand Down Expand Up @@ -137,14 +137,15 @@ These sub-lists use mixed indentation (spaces and tabs).


- [gtkada] - Ada graphical toolkit based on Gtk3 components (issue #161 link reference below but checked by `remark-lint-no-undefined-references` not `rules/list-item.js`).
- [*example* `code`][exampleref] - Another linkref but with children.
- [foo](https://foo.com) ![stars](https://img.shields.io/github/stars/foo/foo.svg) - Valid description.
- ![v3](img/vapor-3.png) [API Error Middleware](https://github.com/skelpo/APIErrorMiddleware) - Vapor middleware for converting thrown errors to JSON responses.
- ![v2](img/vapor-2.png) ![v3](img/vapor-3.png) [Bugsnag](https://github.com/nodes-vapor/bugsnag) - Report errors with Bugsnag.
- [ArcGIS location services - Postman Workspace](https://www.postman.com/arcgis-developer/workspace/arcgis-location-services) - Official Postman collections to work with the Geocoding & Search API, Routing & Directions API, Demographics & GeoEnrichment API, Data hosting and more (issue #146).
- [rmw](https://github.com/ros2/rmw/tree/master/rmw) - Contains the ROS middleware API ![rmw](https://img.shields.io/github/stars/ros2/rmw.svg) (issue #49).
<!-- TODO
<!-- TODO
- [__Compiling machine learning programs via high-level tracing__. Roy Frostig, Matthew James Johnson, Chris Leary. _MLSys 2018_.](https://mlsys.org/Conferences/doc/2018/146.pdf) - This white paper describes an early version of JAX, detailing how computation is traced and compiled (issue #136)
-->

[gtkada]: https://github.com/AdaCore/gtkada

[exampleref]: https://example.com
5 changes: 4 additions & 1 deletion test/fixtures/list-item/1.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,7 @@ Test description's ending punctuation.

- [foo](https://foo.com) - Quote-inducing double punctuation “end…”??!
- [foo](https://foo.com) - Quote-inducing double punctuation “end?…...”…...?
- [gtkada] - reference link with no reference
- [gtkada] - Reference link with no reference.
- [*example* ![img](https://image.img)][exampleref] - Another linkref but with a bad child.

[exampleref]: https://ref.com
5 changes: 5 additions & 0 deletions test/rules/snapshots/list-item.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@ Generated by [AVA](https://avajs.dev).
message: 'List item description must end with proper punctuation',
ruleId: 'awesome-list-item',
},
{
line: 74,
message: 'Invalid list item link',
ruleId: 'awesome-list-item',
},
]

## list-item - invalid sublist punctuation
Expand Down
Binary file modified test/rules/snapshots/list-item.js.snap
Binary file not shown.

0 comments on commit 749034a

Please sign in to comment.