mui / material-ui

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.
https://mui.com/material-ui/
MIT License
93.32k stars 32.12k forks source link

[docs-infra] Test the link check script #43200

Open alexfauquette opened 1 month ago

alexfauquette commented 1 month ago
          The cleanest way I can think of would be to extract the script logic into packages-internal/scripts, test it there and leave just the CLI in the scripts directory.

Originally posted by @michaldudak in https://github.com/mui/material-ui/issues/43144#issuecomment-2270663097

For context, the script which takes care of verifying each internal link point to an existing page, and an existing anchor was doing nothing (except eating some CPU time)

It would be nice to have a test that ensures it fails

The idea would be to have two markdown files, one with broken links, one with ok links, and run test that ensure the script is failing on the correct one and passing the other one.

This should avoid the issue we got with the script silently failing because it detected no link

Search keywords:

DiegoAndai commented 3 weeks ago

Hey @alexfauquette, what needs to be fixed specifically?

alexfauquette commented 3 weeks ago

This issue is about testing the script is working as expected.

The idea would be to have two markdown files, one with broken links, one with ok links, and run test that ensure the script is failing on the correct one and passing the other one.

This should avoid the issue we got with the script silently failing because it detected no link