Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit tests for remark/rehype plugins #125

Merged
merged 1 commit into from
Jan 31, 2025

Conversation

ptgott
Copy link
Contributor

@ptgott ptgott commented Jan 29, 2025

See #17

Migrate unit tests for our custom remark and rehype plugins from the archived gravitational/docs repo. Convert these tests to Jest, which unlike the uvu testing tool we used for gravitational/docs, is still being maintained. Add a GitHub Actions workflow to run the tests on pull requests.

To get the remark-includes test to pass, edit the updatePaths function to only extract a version number from the path of a partial if the partial falls under a directory path for production content.

Copy link

github-actions bot commented Jan 29, 2025

Amplify deployment status

Branch Commit Job ID Status Preview Updated (UTC)
paul.gottschling/17-test-suite 4a89959 51 ✅SUCCEED paul-gottschling-17-test-suite 2025-01-31 14:07:35

@ptgott ptgott force-pushed the paul.gottschling/17-test-suite branch from 6ef75eb to 1021c27 Compare January 29, 2025 22:51
@ptgott ptgott requested a review from avatus January 29, 2025 22:58
@ptgott
Copy link
Contributor Author

ptgott commented Jan 30, 2025

I'm happy to split this one up if it makes it easier to review. Most of the files in this PR are test fixtures.

Copy link

@avatus avatus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests are passing so LGTM

@ptgott
Copy link
Contributor Author

ptgott commented Jan 30, 2025

@avatus Thanks! I've looked into why preview builds are failing, and it might be an issue with the updatePaths function I changed to get tests for remark-includes to work. I'll push a separate commit with the changes so you can review them.

@ptgott ptgott force-pushed the paul.gottschling/17-test-suite branch from 1021c27 to c2c089f Compare January 30, 2025 21:33
@ptgott ptgott force-pushed the paul.gottschling/17-test-suite branch from c2c089f to 4a322cc Compare January 30, 2025 21:42
@ptgott ptgott force-pushed the paul.gottschling/17-test-suite branch from 4a322cc to 723bbbb Compare January 30, 2025 22:05
@ptgott ptgott force-pushed the paul.gottschling/17-test-suite branch from 723bbbb to 573b52e Compare January 30, 2025 22:13
@ptgott
Copy link
Contributor Author

ptgott commented Jan 30, 2025

@avatus I've removed the remark-includes tests and related changes from the branch, so hopefully that will get the preview deployment step to work.

@ptgott ptgott force-pushed the paul.gottschling/17-test-suite branch from 573b52e to 6db499b Compare January 30, 2025 22:20
See #17

Migrate unit tests for our custom remark and rehype plugins from the
archived `gravitational/docs` repo. Convert these tests to Jest, which
unlike the uvu testing tool we used for `gravitational/docs`, is still
being maintained. Add a GitHub Actions workflow to run the tests on pull
requests.

This change does not add tests for `remark-includes`, which requires
some changes to how the site processes link paths.
@ptgott ptgott force-pushed the paul.gottschling/17-test-suite branch from 6db499b to 4a89959 Compare January 31, 2025 13:56
@ptgott ptgott merged commit 73cedf6 into main Jan 31, 2025
5 checks passed
@ptgott ptgott deleted the paul.gottschling/17-test-suite branch January 31, 2025 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants