Skip to content

lint-files test fails on Windows #318

Description

@jeffmcaffer

What is the current behavior?

8 of the relative URLs must start with "/" tests in tests/content/lint-files.js fail because of some windows pathing issues. Here is one example.

 FAIL  tests/content/lint-files.js (217.925 s)
  ● lint-files › in "content\actions\hosting-your-own-runners\monitoring-and-troubleshooting-self-hosted-runners.md" › relative URLs must start with "/"

    Custom message:
      Found unexpected relative article links:
      - [962]: Starting
      - [962]: Started
      - [962]: Started
      - [962]: √
      - [962]: 2020-02-11
      - [962]: 2020-02-11
      - [962]: 2020-02-11

    expect(received).toBe(expected) // Object.is equality

    Expected: 0
    Received: 7

      178 |
      179 |         const errorMessage = formatLinkError(relativeArticleLinkErrorText, matches)
    > 180 |         expect(matches.length, errorMessage).toBe(0)
          |                                              ^
      181 |       })
      182 |
      183 |       test('URLs must not contain a hard-coded language code', async () => {

      at Object.<anonymous> (tests/content/lint-files.js:180:46)

What changes are you suggesting?

The problem is with the relative path computations near the beginning of the test. These should be wrapped with a slash call.

cc: @github/docs-engineering , @chiedo

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn error or flaw that causes unintended or unexpected resultsengineeringWill involve Docs Engineering

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions