-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
chore: implement @puppeteer/doctest
#10933
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jrandolf-2
force-pushed
the
jrandolf/doctest
branch
14 times, most recently
from
September 19, 2023 00:08
f9d4077
to
ccfbe6e
Compare
I think it is a good idea, I will let @Lightning00Blade to do the review |
OrKoN
reviewed
Sep 19, 2023
jrandolf-2
force-pushed
the
jrandolf/doctest
branch
5 times, most recently
from
September 19, 2023 09:29
9c64054
to
2eb5af9
Compare
jrandolf-2
force-pushed
the
jrandolf/doctest
branch
from
September 19, 2023 09:33
2eb5af9
to
0da3689
Compare
jrandolf-2
force-pushed
the
jrandolf/doctest
branch
3 times, most recently
from
September 19, 2023 09:39
96f269d
to
6aba40f
Compare
jrandolf-2
force-pushed
the
jrandolf/doctest
branch
2 times, most recently
from
September 19, 2023 10:36
b9bb0b4
to
034ccdd
Compare
jrandolf-2
force-pushed
the
jrandolf/doctest
branch
3 times, most recently
from
September 19, 2023 10:55
3483c78
to
c6aedea
Compare
jrandolf-2
force-pushed
the
jrandolf/doctest
branch
2 times, most recently
from
September 19, 2023 12:52
c3f736b
to
74d7fdb
Compare
jrandolf-2
force-pushed
the
jrandolf/doctest
branch
7 times, most recently
from
September 19, 2023 14:42
d0fdf9e
to
1dd00c2
Compare
Lightning00Blade
approved these changes
Sep 19, 2023
jrandolf-2
force-pushed
the
jrandolf/doctest
branch
from
September 19, 2023 14:51
1dd00c2
to
71d3657
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements a documentation example tester, similar to the one in Rust.
Usage
Details
@puppeteer/doctest
looks through compiled code for@example
comments with fenced code blocks. It will then parse out the code within the fence and run it using Node's test runner.The first line containing the starting fence defines the options for a given fenced code block. For example,
```ts
defines a TypeScript code block.```
defines a JavaScript code block.```ts ignore
defines a TypeScript code block that is ignored for testing.Note that
``` ignore
and```ignore
are different. The former is an ignored JS code block. The latter is a code block for the
ignore
language.If there are several code blocks within an example, they are concatenated before running.