Skip to content

Commit 22079e3

Browse files
author
Stefan Fruhner
committed
Add a test for --skip-header
1 parent d815f39 commit 22079e3

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/tests.bats

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,30 @@ load test_helper
3030

3131
}
3232

33+
@test "TOC for local README.md with skip headers" {
34+
run $BATS_TEST_DIRNAME/../gh-md-toc --skip-header README.md
35+
assert_success
36+
37+
assert_equal "${lines[0]}" "Table of Contents"
38+
assert_equal "${lines[1]}" "================="
39+
assert_equal "${lines[2]}" "* [Installation](#installation)"
40+
assert_equal "${lines[3]}" "* [Usage](#usage)"
41+
assert_equal "${lines[4]}" " * [STDIN](#stdin)"
42+
assert_equal "${lines[5]}" " * [Local files](#local-files)"
43+
assert_equal "${lines[6]}" " * [Remote files](#remote-files)"
44+
assert_equal "${lines[7]}" " * [Multiple files](#multiple-files)"
45+
assert_equal "${lines[8]}" " * [Combo](#combo)"
46+
assert_equal "${lines[9]}" " * [Auto insert and update TOC](#auto-insert-and-update-toc)"
47+
assert_equal "${lines[10]}" " * [GitHub token](#github-token)"
48+
assert_equal "${lines[11]}" " * [TOC generation with Github Actions](#toc-generation-with-github-actions)"
49+
assert_equal "${lines[12]}" "* [Tests](#tests)"
50+
assert_equal "${lines[13]}" "* [Dependency](#dependency)"
51+
assert_equal "${lines[14]}" "* [Docker](#docker)"
52+
assert_equal "${lines[15]}" " * [Local](#local)"
53+
assert_equal "${lines[16]}" " * [Public](#public)"
54+
assert_equal "${lines[17]}" "Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc)"
55+
56+
}
3357
@test "TOC for remote README.md" {
3458
run $BATS_TEST_DIRNAME/../gh-md-toc https://github.com/ekalinin/sitemap.js/blob/6bc3eb12c898c1037a35a11b2eb24ababdeb3580/README.md
3559
assert_success

0 commit comments

Comments
 (0)