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

integrations/viem: doctests #419

Merged
merged 7 commits into from
Oct 1, 2024
Merged

Conversation

CedarMist
Copy link
Member

Adds tests to ensure the README.md examples from integrations/viem-v2 can be imported.

This will catch any glaring errors. I think we should extend this to all of the packages in this repo.

@CedarMist CedarMist added docs Documentation javascript Pull requests that update JavaScript code integrations labels Sep 27, 2024
@CedarMist CedarMist requested review from lukaw3d and aefhm September 27, 2024 05:57
@CedarMist CedarMist self-assigned this Sep 27, 2024
Copy link

netlify bot commented Sep 27, 2024

Deploy Preview for oasisprotocol-sapphire-paratime canceled.

Name Link
🔨 Latest commit 9c56c7b
🔍 Latest deploy log https://app.netlify.com/sites/oasisprotocol-sapphire-paratime/deploys/66fbdd4655dd240009a17566

@CedarMist CedarMist force-pushed the CedarMist/typescript-doctests branch from 4595219 to d95f7ef Compare September 27, 2024 06:00
@CedarMist CedarMist marked this pull request as ready for review September 27, 2024 06:12
@CedarMist CedarMist requested a review from rube-de September 27, 2024 06:12
integrations/viem-v2/README.md Outdated Show resolved Hide resolved
integrations/viem-v2/package.json Outdated Show resolved Hide resolved
@CedarMist CedarMist force-pushed the CedarMist/typescript-doctests branch from 0ac684f to 3e3e2d2 Compare September 30, 2024 10:49
@CedarMist CedarMist requested a review from rube-de September 30, 2024 16:51
@CedarMist CedarMist force-pushed the CedarMist/typescript-doctests branch from a13325f to ddab09b Compare September 30, 2024 18:27
integrations/viem-v2/hardhat.config.cjs Outdated Show resolved Hide resolved
integrations/viem-v2/package.json Outdated Show resolved Hide resolved
@lukaw3d
Copy link
Member

lukaw3d commented Oct 1, 2024

Nice!


If we'll need snippets that skip some initialization code - copying a comment from slack:
For previous attempts at testing code in markdown we pulled code in from tests:

New idea that would work with npm and github markdown without generating them:

  • keep code as is in markdown
  • add same code to files in tests
  • add test that checks that code is found in a test (ignore indentation/whitespace)

@CedarMist CedarMist force-pushed the CedarMist/typescript-doctests branch from 7f2f313 to 9c56c7b Compare October 1, 2024 11:30
@CedarMist CedarMist added this to the integrations-viem-2.0.2 milestone Oct 1, 2024
@CedarMist CedarMist enabled auto-merge October 1, 2024 11:33
@CedarMist CedarMist merged commit 7e252fb into main Oct 1, 2024
10 checks passed
@CedarMist CedarMist deleted the CedarMist/typescript-doctests branch October 1, 2024 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation integrations javascript Pull requests that update JavaScript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants