mirror of
				https://github.com/theoludwig/markdownlint-rule-relative-links.git
				synced 2025-11-01 00:49:07 +01:00 
			
		
		
		
	feat: html anchor support
This commit is contained in:
		@@ -65,16 +65,22 @@ test("ensure the rule validates correctly", async (t) => {
 | 
			
		||||
      const lintResults = await validateMarkdownLint(
 | 
			
		||||
        "test/fixtures/invalid/non-existing-heading-fragment/non-existing-heading-fragment.md",
 | 
			
		||||
      )
 | 
			
		||||
      assert.equal(lintResults?.length, 1)
 | 
			
		||||
      assert.deepEqual(lintResults?.[0]?.ruleNames, relativeLinksRule.names)
 | 
			
		||||
      assert.equal(
 | 
			
		||||
        lintResults?.[0]?.ruleDescription,
 | 
			
		||||
        relativeLinksRule.description,
 | 
			
		||||
      )
 | 
			
		||||
      assert.equal(lintResults?.length, 2)
 | 
			
		||||
      for (let i = 0; i < 2; i++) {
 | 
			
		||||
        assert.deepEqual(lintResults?.[i]?.ruleNames, relativeLinksRule.names)
 | 
			
		||||
        assert.equal(
 | 
			
		||||
          lintResults?.[i]?.ruleDescription,
 | 
			
		||||
          relativeLinksRule.description,
 | 
			
		||||
        )
 | 
			
		||||
      }
 | 
			
		||||
      assert.equal(
 | 
			
		||||
        lintResults?.[0]?.errorDetail,
 | 
			
		||||
        '"./awesome.md#non-existing-heading" should have a valid fragment identifier',
 | 
			
		||||
      )
 | 
			
		||||
      assert.equal(
 | 
			
		||||
        lintResults?.[1]?.errorDetail,
 | 
			
		||||
        '"./awesome.md#non-existing-heading-anchor" should have a valid fragment identifier',
 | 
			
		||||
      )
 | 
			
		||||
    })
 | 
			
		||||
 | 
			
		||||
    await t.test("with a non-existing file", async () => {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user